Skip to main content

pySCIL

New deployment of the SCIL toolset using NLP tools from Python

The Socio-cultural Content in Language (SCIL) toolset intents to explore and develop novel designs, algorithms, methods, techniques and technologies to extend the discovery of the social goals of members of a group by correlating these goals with the language they use. (description via IARPA)

Installation

The following are instructions on how to install pySCIL from PyPI.

Type the following in your terminal. Make sure you are using Python 3.6+

pip install pySCIL

Usage

Include the above imports at the top of your program file

import json
from scil import scil

To begin analyzing a dialogue type the following code

with open("pathtojson.json") as f:
  obj = scil.SCIL(f)
obj.preprocessStanford()

Make sure that your json file is formatted properly. An example can be seen in the jsontemplate.json file

You can also use the NLTK Part of Speech tagger. It has noticeably less accuracy but is also a lot faster. To use it you can use obj.preprocessNLTK()

From here, you can now start to call functions to do analysis on the data. See below functions section for more details. As an example.

print(obj.TopicControlFunctions([1,0.5,0.5,0.5]))

Functions

Each service has a main function that gathers data from all sub-functions and creates a combined metric. These sub-functions can also be called individually. Below are all the callable functions outlined along with what sort of data they require to be present in the provided json file.

  • TopicControlFunctions(weights)
    • weights are optional and default to [1,1,1,1]
    • LocalTopicIntroduction()
    • SubsequentMentionsLocalTopics()
    • CiteScore()
    • TurnLength()
  • TaskControlFunctions(weights)
    • weights are optional and default to [1,1,1]
    • DirectiveIndex()
      • requires "dialog_act" tags
    • ProcessManagementIndex()
      • requires "dialog_act" metaTags
    • ProcessManagementSuccessIndex()
      • requires "dialog_act" tags and metaTags
      • requires "link_to"
  • ArgumentDiversityFunctions(weights)
    • weights are optional and default to [1,1]
    • VocabularyRangeIndex()
    • VocabularyIntroductionMeasure()
  • TopicalPositioningFunctions()
    • TopicalPolarityIndex()
      • requires "dialog_act" tags
      • requires "polarity"
      • requires "turn_no"
      • requies "link_to"
    • PolarityStrengthIndex()
      • requires "dialog_act" tags
      • requires "polarity"
      • requires "turn_no"
      • requies "link_to"
  • AgreementFunctions(weights)
    • weights are optional and default to [1,1]
    • AgreeAcceptIndex()
      • requires "dialog_act" tags
    • TopicalAgreementIndex()
      • requires "topic"
      • requires "polarity"
      • requires "dialog_act" tags
  • DisagreementFunctions(weights)
    • weights are optional and default to [1,1]
    • DisagreeRejectIndex()
      • requires "dialog_act" tags
    • TopicalDisagreementIndex
      • requires "topic"
      • requires "polarity"
      • requires "dialog_act" tags
  • EmotiveLanguageUseFunctions(weights)
    • weights are optional and default to [1]
    • this service currently only has one sub-function
    • EmotiveWordIndex()
  • SocialPositioningFunctions(weights)
    • weights are optional and default to [1,1]
    • OfferCommitIndex()
      • requires "dialog_act" tags
    • ConfirmationRequestIndex()
      • requires "dialog_act" tags
  • SociabilityFunctions(weights)
    • weights are optional and default to [1,1,1,1]
    • ConversationalNormsMeasure()
      • requires "dialog_act" tags
      • requires "link_to"
      • requires "comm_act_type"
    • AgreementDisagreementMeasure()
      • requires "dialog_act" tags
    • NetworkDensityIndex()
      • requires "comm_act_tag"
    • CiteDisparityIndex()
      • requires "link_to"
  • InvolvementFunctions(weights)
    • weights are optional and default to [1,1,1,1,1]
    • NounPhraseIndex()
    • TurnIndex()
    • TopicChainIndex(gapSizeCutoff, mentionPercentageFloor)
      • a new topic will be created if last mention was more than gapSizeCutoff turns ago (defaults to 10)
      • only topics with at least mentionPercentageFloor of mentions will be included as top topics (defaults to 0.05 as in 5%)
      • requires "turn_no"
    • AllSubsequentMentions()
    • AllotopicalityIndex()
  • NetworkCentralityFunctions(weights)
    • weights are optional and default to [1,1]
    • CommunicationLinksMeasure
      • requires "link-to"
    • MesoTopicIntroduction()
  • TaskFocusFunctions(weights)
    • weights are optional and default to [1,1]
    • MesoTopicStructureMeasure()
    • MesoTopicGappingMeasure()
  • TensionFocusFunctions(weights)
    • weights are optional and default to [1,1]
    • DisagreeRejectTargetIndex()
      • requires "link_to"
      • requires "dialog_act" tags
    • TopicalDisagreementTargetIndex()
      • requires "link_to"
      • requires "topic"
      • requires "polarity"
  • Leadership(topicControlScores, taskControlScores, involvementScores, disagreementScores, weights)
    • weights are optional and default to [0.45,0.4,0.05,0.1]
    • all scores are the output of the Functions() functions
  • Influencer(argumentDiversityScores, networkCentralityScores, topicControlScores, disagreementScores, weights)
    • weights are optional and default to [0.4,0.5,0.75,0.15]
  • PursuitOfPower(topicControlScores, disagreementScores, tensionFocusScores, networkCentralityScores, weights)
    • weights are optional and default to [0.8,0.09,0.02,0.09]
  • GroupCohesion(topicControlScores, taskControlScores, involvementScores, agreementScores, disagreementScores, sociabilityScores, taskFocusScores, sociabilityThreshold, taskFocusTreshold, prmMesoTopicFloor, prmDialogueFloor, prmThreshold, prmWeights, dpmThreshold)
    • sociabilityThreshold defaults to 0.68. If sociability is at least threshold, add 0.25 to GroupCohesion
    • taskFocusThreshold defaults to 0.32. If taskFocus is at least threshold, add 0.25 to GroupCohesion
    • prmMesoTopicFloor defaults to 3. PRM ignores conversations with less than 3 meso topics (unless it has more than 150 utterances)
    • prmDialogueFloor defaults to 150. PRM ignores conversations with less than 150 utterances (unless it has at least 3 meso topics)
    • prmThreshold defaults to 0.75. If PRM is at least threshold, add 0.25 to GroupCohesion
    • prmWeights is optional and defaults to [1,0.9,0.3,0.7,0.7]. The weights are for topicControl, taskControl, involvement, agreement, disagreement
    • dpmThreshold defaults to 0.69. If DPM is at least threshold, add 0.25 to GroupCohesion

Services

Agenda Control Class

Topic Control

Attempts by a discourse participant or participants to impose the topic of conversation.

Task Control

The effort by one or more members of a group to define the group's project goal and/or steer the group towards it.

Argument Diversity

Displayed by speakers who deploy a broader range of arguments in conversation.

Topical Positioning

The attitude a speaker has on main the topics (meso-topics) of discussion.

Interpersonal Relations Class

Agreement

Signaled when discourse participants make explicit, unqualified utterances of agreement, approval, or acceptance in response to a prior speaker's utterance.

Disagrement

Signaled when discourse participants make explicit, utterances of disagreement, disapproval, or rejection in response to a prior speaker's utterance.

Emotive Language Use

Defined as a degree to which speakers attempt to influence readers or listeners by appealing to their emotions.

Social Positioning

Defined as a degree to which the speaker attempts to position oneself as central in the group by committing to some future activity and by getting others to confirm or re-affirm what the speaker stated or committed to, as well as what the speaker already believes.

Sociability

Defined as a degree of socio-emotional involvement between speakers, including observance of group conversational norms.

Participation and Engagement Class

Involvement

Defined as a degree of engagement or participation in the discussion of a group.

Network Centrality

Defined as the degree to which a speaker is someone to whom others direct their comments and/or whose topics they cite.

Task Focus

Defined as a degree to which speakers remain engaged in a group task.

Tension Focus

Defined as the degree to which a speaker is someone at whome others direct their disagreement, or with whose topics they disagree the most.

** WIP **

Release files for pySCIL 0.0.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pySCIL 0.0.12
File Size Uploaded
pySCIL-0.0.12.tar.gz 21.6 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for pySCIL 0.0.12
File Interpreter ABI Platform
pySCIL-0.0.12-py3-none-any.whl Python 3 none any Details

Total release size: 43.4 MB

Release files / pySCIL-0.0.12.tar.gz

Download URL pySCIL-0.0.12.tar.gz
Size 21.6 MB
Tags Source
SHA-256 checksum
How to use checksums
5282f6a20f10a9805615ea47803554d2ff7b123e505b21519e0863497b4b084d
BLAKE2b-256 checksum
How to use checksums
e1262f74c2085466d3d177155fd171c43bd5cb09c79ed808ce874fcfd341de84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release files / pySCIL-0.0.12-py3-none-any.whl

Download URL pySCIL-0.0.12-py3-none-any.whl
Size 21.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
c66be9cfc718fef34232378573040118a4f7ae18062b574046c1b913c59fee16
BLAKE2b-256 checksum
How to use checksums
fc73ccf0b648e2f4c278c6e9ce5d5bab6bee567a62e8fd885e1f53af74515795
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release history Release notifications | RSS feed

This release

0.0.12 This release

2 release files

0.0.11

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page