Skip to main content

Automated text analysis with networks

Project description

Launch on Binder CI status Documentation Status Install with conda Published in Journal of Open Source Software

textnets represents collections of texts as networks of documents and words. This provides novel possibilities for the visualization and analysis of texts.

Bipartite network graph

Network of U.S. Senators and words used in their official statements following the acquittal vote in the 2020 Senate impeachment trial (source).

The ideas underlying textnets are presented in this paper:

Christopher A. Bail, “Combining natural language processing and network analysis to examine how advocacy organizations stimulate conversation on social media,” Proceedings of the National Academy of Sciences of the United States of America 113, no. 42 (2016), 11823–11828, doi:10.1073/pnas.1607151113.

Initially begun as a Python implementation of Chris Bail’s textnets package for R, textnets now comprises several unique features for term extraction and weighing, visualization, and analysis.

textnets is free software under the terms of the GNU General Public License v3.


textnets builds on spaCy, a state-of-the-art library for natural-language processing, and igraph for network analysis. It uses the Leiden algorithm for community detection, which is able to perform community detection on the bipartite (word–group) network.

textnets seamlessly integrates with Python’s excellent scientific stack. That means that you can use textnets to analyze and visualize your data in Jupyter notebooks!

textnets is easily installable using the conda and pip package managers. It requires Python 3.8 or higher.

Read the documentation to learn more about the package’s features.


Using textnets in a scholarly publication? Please cite this paper:

  author   = {John D. Boy},
  title    = {textnets},
  subtitle = {A {P}ython Package for Text Analysis with Networks},
  journal  = {Journal of Open Source Software},
  volume   = {5},
  number   = {54},
  pages    = {2594},
  year     = {2020},
  doi      = {10.21105/joss.02594},

Learn More



Issues & Ideas








textnets logo

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

textnets-0.8.3.tar.gz (130.8 kB view hashes)

Uploaded Source

Built Distributions

textnets-0.8.3-cp310-cp310-win_amd64.whl (131.7 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

textnets-0.8.3-cp310-cp310-manylinux_2_31_x86_64.whl (128.1 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.31+ x86-64

textnets-0.8.3-cp310-cp310-macosx_11_0_x86_64.whl (112.1 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ x86-64

textnets-0.8.3-cp39-cp39-win_amd64.whl (131.7 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

textnets-0.8.3-cp39-cp39-manylinux_2_31_x86_64.whl (127.9 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.31+ x86-64

textnets-0.8.3-cp39-cp39-macosx_10_16_x86_64.whl (106.2 kB view hashes)

Uploaded CPython 3.9 macOS 10.16+ x86-64

textnets-0.8.3-cp38-cp38-win_amd64.whl (131.7 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

textnets-0.8.3-cp38-cp38-manylinux_2_31_x86_64.whl (128.8 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.31+ x86-64

textnets-0.8.3-cp38-cp38-macosx_10_16_x86_64.whl (106.2 kB view hashes)

Uploaded CPython 3.8 macOS 10.16+ x86-64

Supported by

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