Skip to main content

text2graph-API

Use this library for text-to-graph tranformations. To use the API it is necessary to install its modules and dependencies in the user’s application. Also, the corpus of text documents to be transformed into graphs has to be loaded and read.

text2graphapi is a text to graph transformation pipeline that consists of four main modules::

  • Text Preprocessing and Normalization. This module aims to perform all the cleaning and pre-processing part of the text. Apply NLP methods such as POS-Tag, Lemm, Stem, etc.
  • Graph Model. This module aims to define the entities/nodes and their relationships/edges according to the problem specification.
  • Graph Extraction. This module aims to build the graph according to the selected model. We use third-party libraries such as NetworkX.
  • Graph Transformation and Analysis. This module aims to apply vector transformations to the graph as final output, such as adjacency matrix, dense matrix, etc.

Where to get it

# from PYPI
pip install text2graphapi

Example input data

# Has to be a list of dict, where ecah dict conatins an 'id' and 'doc' text data
input_text_docs = [{"id": 1, "doc": "text_data_1"},
                   {"id": 2, "doc": "text_data_2"}]

How to use it

from text2graphapi.src.Cooccurrence import Cooccurrence

to_cooccurrence = Cooccurrence(
                graph_type = 'DiGraph', 
                apply_prep = True, 
                parallel_exec = False,
                window_size = 1, 
                language = 'en',
                output_format = 'adj_matrix')
                
output_text_graphs = to_cooccurrence.transform(corpus_docs)

Release files for text2graphapi 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for text2graphapi 0.1.1
File Size Uploaded
text2graphapi-0.1.1.tar.gz 17.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for text2graphapi 0.1.1
File Interpreter ABI Platform
text2graphapi-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 34.5 kB

Release files / text2graphapi-0.1.1.tar.gz

Download URL text2graphapi-0.1.1.tar.gz
Size 17.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e54beeba8de5230ee6dcf3b280e6196fd14ce8cb161f09f02fc65f5ee84af60c
BLAKE2b-256 checksum
How to use checksums
d1a105e110b09048a97a0a85dfaa36e734c4ba82eafbc10e75495c76c0dc0678
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.12

Release files / text2graphapi-0.1.1-py3-none-any.whl

Download URL text2graphapi-0.1.1-py3-none-any.whl
Size 17.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
89d5ba73032713dd77a0593a149a0f6ca5e7cfe934c7f068ed881a456660c636
BLAKE2b-256 checksum
How to use checksums
aa0065762dffde40830bcdb543abebf6284db27b58ed08299c73a69e24142cf5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.12

Release history Release notifications | RSS feed

0.2.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

This release

0.1.1 This release

2 release files

0.1.0

2 release files

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page