Skip to main content

Character interaction temporal graph analysis

Project description

license package publish

CharNet: Dynamic Social Network Analysis for TV Series Dialogues

CharNet is a Python package designed for performing graph analysis on dynamic social networks based on dialogues in TV series. It provides tools for loading dialogue data, calculating and creating weighted graphs, and visualizing character interactions over time.

Simple example


from charnet import CharNet
import pandas as pd

df = pd.read_csv('your_tv_series_data.csv')
net = CharNet(df, ('Season', 'Episode', 'Scene', 'Line'),
              interactions='Words', speakers='Speaker', listeners='Listener')
net.get_weights(lambda x: len(x))
net.set_min_step('Scene')
subset = net.get_interval((1, 1, 1, 1), (1, 2, 1, 1))
subset.normalize_weights()
subset.set_layout('circular')
subset.draw(plot='matplotlib')

from charnet.analysis import simple_degree

degree_results = simple_degree(subset, weighted=True)
degree_results.to_csv('results.csv', index=False)

Install


Install the latest version of CharNet:

$ pip install src

Install with all optional dependencies:

$ pip install src[all]

To Do

  • Add non-directed graph support
  • Add closeness centrality
  • Add Eigenvector centrality
  • Add Louvain community detection
  • Add temporal graph support

License

Released under the GNU General Public License v3.0.

Copyright (c) 2024 Media Comprehension Lab

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

charnet-0.0.1.1.tar.gz (20.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

charnet-0.0.1.1-py3-none-any.whl (40.7 kB view details)

Uploaded Python 3

File details

Details for the file charnet-0.0.1.1.tar.gz.

File metadata

  • Download URL: charnet-0.0.1.1.tar.gz
  • Upload date:
  • Size: 20.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for charnet-0.0.1.1.tar.gz
Algorithm Hash digest
SHA256 47ba271dc089cdd77f6409230b9f646b455d15e0ec7a030f4956053670facae0
MD5 3b950538de60886e0456eaded68c2881
BLAKE2b-256 a8f6d28f5972deacf4bf33b696c4cb1ce27aa2a355521c2970840fe784624c70

See more details on using hashes here.

File details

Details for the file charnet-0.0.1.1-py3-none-any.whl.

File metadata

  • Download URL: charnet-0.0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 40.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for charnet-0.0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4316a6acb88cdfb18387cecf597dfcb135b1c98c8508e80fa8fdc4bc9f97e67b
MD5 f662c18c3bae658653a81b317251deb3
BLAKE2b-256 09c8a0c5b1df4b8681b97003cdc37376a1d4c25c650f282ac74d1cf1743a249d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page