Skip to main content

A Python package for managing Telugu stop words.

Project description

Telugu Stopwords

A comprehensive Python library for Telugu stopwords, designed for natural language processing (NLP) tasks such as text preprocessing for hate speech detection, sentiment analysis, and topic modeling.

Features

  • Extensive list of Telugu stopwords in both Telugu script and English transliteration.
  • Support for adding/removing custom stopwords.
  • JSON save/load functionality for easy integration.
  • Simple function to remove stopwords from text.
  • Compatible with code-mixed Telugu-English text (e.g., social media).
  • User-friendly imports with aliases: tsw for TeluguStopWords and rmtsw for remove_stopwords.
  • Stopwords sorted to prioritize Telugu script for better readability.

Installation

Install via pip:

pip install telugu-stopwords

Or install directly from GitHub:

pip install git+https://github.com/PavanYellathakota/telugu-stopwords.git

For development, install locally in editable mode:

cd telugu-stopwords
pip install -e .

Usage

from telugu_stopwords import tsw, rmtsw

# Initialize
telugu_sw = tsw()

# Get stopwords
stopwords = telugu_sw.get_stopwords(script="telugu")
print(stopwords[:5])  # ['మరియు', 'లేదా', 'కానీ', 'అయితే', 'ఎందుకంటే']

# Remove stopwords from text
text = "నేను ఈ రోజు చాలా సంతోషంగా ఉన్నాను కాబట్టి బయటకు వెళ్లాలనుకుంటున్నాను"
cleaned = rmtsw(text, script="telugu")
print(cleaned)  # రోజు సంతోషంగా బయటకు వెళ్లాలనుకుంటున్నాను

# Add custom stopwords
telugu_sw.add_stopwords(["రోజు"], script="telugu")

# Save to JSON
telugu_sw.save_to_json("custom_stopwords.json")

Notes

  • tsw is an alias for the TeluguStopWords class.
  • rmtsw is an alias for the remove_stopwords function.
  • Use script="telugu" for Telugu script or script="english" for transliterated stopwords.
  • Stopwords are sorted to prioritize Telugu script characters for better usability.

Project Structure

telugu-stopwords/
├── telugu_stopwords/
│   ├── __init__.py
│   ├── telugu_stopwords.py
├── tests/
│   ├── test_telugu_stopwords.py
├── LICENSE
├── README.md
├── pyproject.toml

Development Setup

  1. Clone the repository:

    git clone https://github.com/PavanYellathakota/telugu-stopwords.git
    cd telugu-stopwords
    
  2. Update pyproject.toml:

    • Ensure project.authors has valid names and email addresses (e.g., name = "Pavan Yellathakota", email = "pavanyellathakota@gmail.com").
  3. Install dependencies:

    pip install pytest
    pip install -e .
    
  4. Run tests:

    pytest tests/
    

Contributing

Contributions are welcome! To contribute:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/your-feature).
  3. Make changes and commit (git commit -m "Add your feature").
  4. Push to your branch (git push origin feature/your-feature).
  5. Open a pull request.

Please include tests for new features and follow the code of conduct.

Testing

Run tests using pytest from the project root:

pytest tests/

License

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

Contact

For questions or suggestions, open an issue or contact:

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

telugu_stopwords-0.1.1.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

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

telugu_stopwords-0.1.1-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: telugu_stopwords-0.1.1.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for telugu_stopwords-0.1.1.tar.gz
Algorithm Hash digest
SHA256 069865f57fc1093be733189d848cc62d2de1b4f0f8403b5f8c93fd18ecdc583d
MD5 2c59b92539d330a314c602418102c9f9
BLAKE2b-256 d4cdd98d061c72a3a2691f5e4b76e0e8604c6e8fc6c32b19f8d71067ede6a847

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for telugu_stopwords-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cd41ba81c07dbdd4a6a2dbb1a84c04b21997599143bfd7e1064cfc37afbef4ef
MD5 1143d31791e9d85b978e417a6727036e
BLAKE2b-256 fc5264e11c593afb26e9c7b5daa8b55a1b339c30cb59d143fa1046e3278b9e8b

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