Skip to main content

Build charachter graphs from text.

Project description

tex2net

Build Status PyPI version License Python Versions

Overview

tex2net is a Python library designed to convert narrative texts into interactive network graphs that visualize character interactions. The library leverages Natural Language Processing (NLP) with spaCy, text rewriting and summarization using Transformer models (T5), network analysis with NetworkX, and interactive visualization with Pyvis and Matplotlib. This tool is perfect for researchers, data scientists, and digital humanities scholars looking to explore complex narrative structures.

Features

  • Text Preprocessing & Entity Extraction: Extract characters from text using spaCy's Named Entity Recognition.
  • Graph Construction: Build directed graphs representing character interactions, annotated with actions and sentence IDs.
  • Node Merging: Combine nodes with similar character names for consistency.
  • Text Rewriting & Summarization: Use T5 models to rephrase or summarize text, emphasizing clear character-verb-character structures.
  • Network Analysis: Compute centrality measures, detect communities, analyze temporal relationships, and more.
  • Visualization: Create both static (Matplotlib) and interactive (Pyvis) visualizations for in-depth narrative analysis.

Installation

Install the package via pip:

pip install tex2net

Make sure you have all the required dependencies. You can also install them using the provided requirements.txt if needed.

Contributing

Contributions are welcome! Feel free to submit pull requests or open issues to improve the functionality of this library. Please follow the code style and add tests for any new features.

License

This project is licensed under the MIT License.


Happy storytelling and network exploring!

Citation

If you find tex2net helpful in your academic or professional work, please cite the following paper:

graphql Copy @inproceedings{aparicio2023tex2net, title={tex2net: A Package for Storytelling Using Network Models}, author={Aparicio, Joao Tiago and Arsenio, Elisabete and Henriques, Rui}, booktitle={Proceedings of the 41st ACM International Conference on Design of Communication}, pages={119--125}, year={2023} }

or

Aparicio, J. T., Arsenio, E., & Henriques, R. (2023, October). tex2net: A Package for Storytelling Using Network Models. In Proceedings of the 41st ACM International Conference on Design of Communication (pp. 119-125).

You can find the paper at ACM Digital Library: https://dl.acm.org/doi/pdf/10.1145/3615335.3623022.

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

tex2net-0.1.0.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

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

tex2net-0.1.0-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file tex2net-0.1.0.tar.gz.

File metadata

  • Download URL: tex2net-0.1.0.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.16

File hashes

Hashes for tex2net-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5a7f65e4427b24d726bcb18b686677aca5660a658b014dd2761216d0951e1b7c
MD5 98f0d496d7cad46dccd8f1f5d5b34ab7
BLAKE2b-256 f72d0b25ba65ecb45cabc87e3fbfda9afd431a8e4d0ad2557998e2c3a89d6246

See more details on using hashes here.

File details

Details for the file tex2net-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tex2net-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 20.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.16

File hashes

Hashes for tex2net-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4b763df5aaf8986ca073ca28994a1b4e06269e687429ff8390a38795bcbd8d69
MD5 c9b54ee27f495db81838fc32a39407fd
BLAKE2b-256 6954cbd6657fe30015b06385b2368059e40695d393a8edf4e8f37595d4c2a26d

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