Skip to main content

A tool for quantitatively measuring the discursive similarity between bodies of text.

Project description

Quantitative Discursive Analysis

(C) 2019 Mark M. Bailey, PhD

About

Quantitative Discursive Analysis (QDA) will convert bodies of text into mathematical graph objects built from noun phrases, where each noun or modifier becomes a vertex, and each edge is determined by how the nouns and vertexes are linked within phrases. The more central the noun is to the overall text content, the higher the centrality measure of that particular noun. Thus, the graph is a weighted representation of discursive content, making it more robust that simple keyword frequencies. This object can be used to mathematically compare the discursive content of two or more bodies of text. This is done by calculating the "resonance" between two bodies of text, where resonance is the cosine angle between the betweenness centralities of the intersection of all vertices. This resonance value is normalized between [0,1], where 0 indicates no discursive similarity, and 1 indicates perfect discursive similarity.

Updates

*2022-10-13: Updated resonance function to be more Pythonic.

More information

This tool is built on NetworkX and TextBlob. Please see relevant documentation for additional information on what other calculations can be done on NetworkX graph objects generated using this library.

Download

https://pypi.org/project/QDA/

Sample Usage

import QDA

Instantiate discursive object.

text_graph = QDA.discursive_object('This is a string of your text. For best results, this string should be at least as long as a typical news article.')

Calculate resonance between two discursive objects.

a = QDA.resonate(text_graph_1, text_graph_2) (noun phrase tuples : list)

Calculate resonance of discursive objects in series.

resonance_series = QDA.resonate_as_series(G_list) (resonance values : dict)

Calculate resonance between all members of a list.

d_community = QDA.discursive_community(G_list)
d_community.A (Resonance adjacency matrix : ndarray)
d_community.G (Graph objhect built from adjacency matrix : NetworkX object)

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

QDA-0.0.2.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

QDA-0.0.2-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file QDA-0.0.2.tar.gz.

File metadata

  • Download URL: QDA-0.0.2.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for QDA-0.0.2.tar.gz
Algorithm Hash digest
SHA256 eb1ace5030c15391ffc434408d6924cc0a1e1f749b8bd1ad62af8bed309617b1
MD5 3539b65f2cc96b1843bc51499767ee44
BLAKE2b-256 70d1ade40ca0dcb23524891f094924a1a63e48ee93552095969a4142c38a2c51

See more details on using hashes here.

File details

Details for the file QDA-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: QDA-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for QDA-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1824fd5ef70d7b21b88e09a6376c01c24ce54cc8078c521524b01a2c58565242
MD5 e15b5b160f85917853bc1fe3c67bf7ab
BLAKE2b-256 38c37d919b54bca17e9e549b1bf30c5ca5488fb6517c622ce4b8db0fb9e42727

See more details on using hashes here.

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