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.
Simple example
import charnet as cn
import pandas as pd
df = pd.read_csv('bigbang_lines_test.csv')
net_test = cn.CharNet(df, ('Season', 'Episode', 'Scene', 'Line'),
interactions='Words', speakers='Speaker', listeners='Listener', directed=True)
net_test.get_weights(lambda x: len(x))
net_test.draw(plot='matplotlib')
net_test.get_weights(lambda x: len(x))
net_test.set_min_step('Scene')
subset = net_test.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 charnet
Install with all optional dependencies:
$ pip install charnet[all]
To Do
- Add non-directed graph support
- Add closeness centrality
- Add Eigenvector centrality
- Add Louvain community detection
- Add temporal visualization
- Add centrality visualizer (with visualization)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file charnet-0.0.3.tar.gz.
File metadata
- Download URL: charnet-0.0.3.tar.gz
- Upload date:
- Size: 20.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e3bfc3da98140e185a042ebd5ebd5ca847583e5507c450563016526639a05b8
|
|
| MD5 |
a0275d1c9dbc9bf7160c8a77887bebe3
|
|
| BLAKE2b-256 |
00f514c8c8cd392271509205aed5bdd41ef9ab92a398a02c228fd09f89bf8d97
|
File details
Details for the file charnet-0.0.3-py3-none-any.whl.
File metadata
- Download URL: charnet-0.0.3-py3-none-any.whl
- Upload date:
- Size: 22.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe4c985fdee1c40cab362659a1681a9e14dc320191aa8d8f449fa44554861b9f
|
|
| MD5 |
459e3b12d75a8f1f5680dd3769ff4daf
|
|
| BLAKE2b-256 |
f157fbfb6fbeaf213893d165df4124bf18d5ebdef4828faebde8686e0da130c3
|