Skip to main content

Python library for word concreteness and imageability analysis.

Project description

WordTangible

PyPI - Version

WordTangible is a Python library for analyzing the concreteness and imageability of words and text. It provides tools to measure how abstract or concrete the language in a given text is, which can be useful for various natural language processing tasks, readability analysis, and linguistic research.

Features

  • Get concreteness ratings for individual words
  • Calculate average concreteness for a given text
  • Compute the ratio of concrete to abstract words in a text
  • Customizable thresholds for concrete and abstract word classification
  • Option to include or exclude stopwords in analysis

Installation

You can install WordTangible using pip:

pip install wordtangible

Usage

Here are some basic examples of how to use WordTangible:

from wordtangible import word_concreteness, avg_text_concreteness, concrete_abstract_ratio

# Get concreteness rating for a single word
print(word_concreteness("apple"))  # Output: 5.0 (highly concrete)

# Calculate average concreteness of a text
text = "The abstract concept of love is as tangible as the apple in your hand."
print(avg_text_concreteness(text))  # Output: ~3.5 (mix of concrete and abstract)

# Get the ratio of concrete to abstract words
print(concrete_abstract_ratio(text))  # Output: ~1.0 (balanced concrete and abstract words)

For more detailed usage instructions and API documentation, please refer to our documentation.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • The concreteness ratings are derived from multiple sources, including the MRC Psycholinguistic Database, Brysbaert et al. concreteness ratings, and Glasgow concreteness ratings.
  • This project uses NLTK for tokenization and stopword filtering.

Citation

If you use WordTangible in your research, please cite it as follows:

Robison, J. (2024). WordTangible: A Python library for word concreteness and imageability analysis. [Software]. Available from https://github.com/jrrobison1/wordtangible

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

wordtangible-0.1.1.tar.gz (222.6 kB view details)

Uploaded Source

Built Distribution

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

wordtangible-0.1.1-py3-none-any.whl (222.2 kB view details)

Uploaded Python 3

File details

Details for the file wordtangible-0.1.1.tar.gz.

File metadata

  • Download URL: wordtangible-0.1.1.tar.gz
  • Upload date:
  • Size: 222.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.14 Darwin/23.6.0

File hashes

Hashes for wordtangible-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3d4464fe1d03f0833b81b49bfb4b2d65b748f5346c235603f6d5ceb10e602b27
MD5 d5cd64ad740afd9f9339364285e086b5
BLAKE2b-256 6cfb3fded0389d5cc0022186d638124c35de07c9b2e02f128d18bad9c6398730

See more details on using hashes here.

File details

Details for the file wordtangible-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: wordtangible-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 222.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.14 Darwin/23.6.0

File hashes

Hashes for wordtangible-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aed66d51b35734c7647b31267e55c0968cd9cd188f48de7684fbbe8d4844a940
MD5 51cd5737fb3ba7a22864efffa568cba2
BLAKE2b-256 e9682fd18d64deeec24d082dcf34ea3ded5ebbc6d6313fbf9d76857ad07a3fdd

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