Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/banjtheman/instatext
Train text classifiers instantly
https://github.com/banjtheman/instatext
Last synced: about 1 month ago
JSON representation
Train text classifiers instantly
- Host: GitHub
- URL: https://github.com/banjtheman/instatext
- Owner: banjtheman
- License: apache-2.0
- Created: 2021-04-07T02:05:21.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-04-14T02:38:28.000Z (over 3 years ago)
- Last Synced: 2024-10-12T09:08:46.797Z (about 1 month ago)
- Language: Python
- Size: 20.5 KB
- Stars: 9
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
instatext: Train text classifiers instantly
====================================`instatext` is a Python 3 library for processing textual data. It provides a simple API for training and predicting with text classifiers.
instatext leverages `fasttext`, and `pandas`, for the heavy lifting
Get it now
----------
$ pip install instatextRequirements
------------- Python >= 3.5
Example
--------
To train a model pass in a csv with the text and labelstext - the text to classify
labels - comma seperated list of labels```
text,labels
sample text,"sample"
bad stuff,"bad,sample"
good stuff,"good,sample"
``````python
import instatext
import loggingdef main():
print("hello")instatext.train_model("test_data/example.csv", "test")
instatext.predict("test", "Predict my good text",0.5)if __name__ == "__main__":
loglevel = logging.INFO
logging.basicConfig(
format="%(asctime)s |%(levelname)s: %(message)s", level=loglevel
)
main()
```