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:
tswforTeluguStopWordsandrmtswforremove_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
tswis an alias for theTeluguStopWordsclass.rmtswis an alias for theremove_stopwordsfunction.- Use
script="telugu"for Telugu script orscript="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
-
Clone the repository:
git clone https://github.com/PavanYellathakota/telugu-stopwords.git cd telugu-stopwords
-
Update
pyproject.toml:- Ensure
project.authorshas valid names and email addresses (e.g.,name = "Pavan Yellathakota", email = "pavanyellathakota@gmail.com").
- Ensure
-
Install dependencies:
pip install pytest pip install -e .
-
Run tests:
pytest tests/
Contributing
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature). - Make changes and commit (
git commit -m "Add your feature"). - Push to your branch (
git push origin feature/your-feature). - 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:
- Pavan Yellathakota: pavanyellathakota@gmail.com
- Prudhvi Yellathakota: prudhviyellathakota@gmail.com
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
069865f57fc1093be733189d848cc62d2de1b4f0f8403b5f8c93fd18ecdc583d
|
|
| MD5 |
2c59b92539d330a314c602418102c9f9
|
|
| BLAKE2b-256 |
d4cdd98d061c72a3a2691f5e4b76e0e8604c6e8fc6c32b19f8d71067ede6a847
|
File details
Details for the file telugu_stopwords-0.1.1-py3-none-any.whl.
File metadata
- Download URL: telugu_stopwords-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd41ba81c07dbdd4a6a2dbb1a84c04b21997599143bfd7e1064cfc37afbef4ef
|
|
| MD5 |
1143d31791e9d85b978e417a6727036e
|
|
| BLAKE2b-256 |
fc5264e11c593afb26e9c7b5daa8b55a1b339c30cb59d143fa1046e3278b9e8b
|