Neural Network to classify short strings
Project description
Char Classifier
---------
Given a short phrase, train a neural network to classify it based on the characters that it contains.
The trainer takes in a file of phrases (separated by new line) and a file of target values (separated by new line).
To train on the sample data (parts of speech classification):
```
from phrase_classifier import PhraseClassificationTrainer, PhraseClassifier
p = PhraseClassificationTrainer("sample/words", "sample/parts-of-speech")
p.train([100, 100], 20, 100)
p.save("sample", "example-run")
```
This will save a trained model with the tag 'example-run' in the sample directory. To use that model, run:
```
k = PhraseClassifier("sample", "example-run")
print k.classify("dog")
```
---------
Given a short phrase, train a neural network to classify it based on the characters that it contains.
The trainer takes in a file of phrases (separated by new line) and a file of target values (separated by new line).
To train on the sample data (parts of speech classification):
```
from phrase_classifier import PhraseClassificationTrainer, PhraseClassifier
p = PhraseClassificationTrainer("sample/words", "sample/parts-of-speech")
p.train([100, 100], 20, 100)
p.save("sample", "example-run")
```
This will save a trained model with the tag 'example-run' in the sample directory. To use that model, run:
```
k = PhraseClassifier("sample", "example-run")
print k.classify("dog")
```
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
char-classifer-0.6.0.tar.gz
(5.7 kB
view details)
Built Distribution
File details
Details for the file char-classifer-0.6.0.tar.gz
.
File metadata
- Download URL: char-classifer-0.6.0.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92ee7ddb37de0f1bcb215264863b2ee4d6234beec10834065360dea142f47a0f |
|
MD5 | 01cc286286326f026f55f3e6be08f0dc |
|
BLAKE2b-256 | 48b0498868c250b119ee16b2b47538a606f9f7a843bde193599cd8a3db0b86da |
File details
Details for the file char_classifer-0.6.0-py2.py3-none-any.whl
.
File metadata
- Download URL: char_classifer-0.6.0-py2.py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a985be66617dc696e31ce8cf96f3d229e27d3f29129c64e193d053508516544 |
|
MD5 | a83883fff1cb8434ec3a6ba91dd8cd9e |
|
BLAKE2b-256 | ac9a5815b75a7faaf9b60d772ed719632e06c26b4722f509f682da93a8156964 |