Skip to main content

Character interaction temporal graph analysis

Project description

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.

Installation

...

Simple example

from app.charnet.src import CharNet
from app.charnet.src import *
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')

# Analysis
degree_results = simple_degree(subset, weighted=True)
# degree_centrality(subset)
# betweenness_centrality(subset)
# closeness_centrality(subset)
# eigenvector_centrality(subset)
degree_results.to_csv('results.csv', index=False)

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.tar.gz (28.8 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-py3-none-any.whl (34.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: charnet-0.0.1.tar.gz
  • Upload date:
  • Size: 28.8 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.tar.gz
Algorithm Hash digest
SHA256 16fadbf0bf7d631db33204656700d0157d64df3956c95cf026d6d5df98177adb
MD5 25faf4019fdca8420042aa242944fb73
BLAKE2b-256 cead5aee943ac0c3438d96b5d91fd94c8703da16173733696db09e6fa9f26297

See more details on using hashes here.

File details

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

File metadata

  • Download URL: charnet-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 34.1 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-py3-none-any.whl
Algorithm Hash digest
SHA256 8aee3524713f99aab547cd41f087802a06d0936c8dc19da19fa0fec51596a176
MD5 24c77a68b634c740c3dd5306f2a15216
BLAKE2b-256 0817d9242cb9ae3376faeb85066d7f16632502801e016ab76cd5896ba7e3111a

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