Skip to main content

ESA-Wiki

Explicit Semantic Analysis based on Wikipedia

This is a python library which contains code to 1) construct a semantic interpreter based on data from Wikipedia and 2) apply this to various kinds of texts.

To construct an interpreter, first obtain a Wikipedia XML dump from http://dumps.wikimedia.org/enwiki/

  1. Then run python3 -m esa_wiki.xml_parse <file> with the downloaded file as its argument. This outputs some temporary files containing information on the words, links and articles encountered.

  2. Next, run python3 -m esa_wiki.generate_indices to generate lists of indices corresponding to unique words and articles encountered

  3. Finally, run python3 -m esa_wiki.matrix_builder to construct a very large sparse interpretation matrix. Each row corresponds to a unique word, each column to a 'concept', i.e. a Wikipedia article, and each entry is the TF-IDF score for word i in article j. The Matrix is saved in separate chunks to conserve memory.

medium_wiki.xml can be used as an example file for demonstration/testing purposes, as it contains only the first 100 or so Wikipedia articles.

cunning_linguistics.py then contains classes to perform text analysis and harvest tweets for analysis.

Metadata

Release files for esa-wiki 0.0.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 esa-wiki 0.0.1
File Size Uploaded
esa_wiki-0.0.1.tar.gz 15.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for esa-wiki 0.0.1
File Interpreter ABI Platform
esa_wiki-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 32.3 kB

Release files / esa_wiki-0.0.1.tar.gz

Download URL esa_wiki-0.0.1.tar.gz
Size 15.0 kB
Tags Source
SHA-256 checksum
How to use checksums
78a4bd39e7d340ea8dc76fad00248d6ab1e464649b09f88909e47ac99038c0d3
BLAKE2b-256 checksum
How to use checksums
a20efa497789f9a3c1a50fdba2ee60d7d765266ddaff51720d78594b7b6f9177
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.23.3 CPython/3.6.5

Release files / esa_wiki-0.0.1-py3-none-any.whl

Download URL esa_wiki-0.0.1-py3-none-any.whl
Size 17.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3571a5fe21f8692761a2f1a4f3b663f91942e878f53bc6ea2078868c5888e5ee
BLAKE2b-256 checksum
How to use checksums
0ee09d54bc3e1ddadf03eb26cd730d61f2ac13201d1d629aca0952a624ab3d4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.23.3 CPython/3.6.5

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

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