Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/NeonGeckoCom/neon-utterance-plugin-postag
https://github.com/NeonGeckoCom/neon-utterance-plugin-postag
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/NeonGeckoCom/neon-utterance-plugin-postag
- Owner: NeonGeckoCom
- Created: 2021-11-28T13:36:48.000Z (about 3 years ago)
- Default Branch: dev
- Last Pushed: 2021-12-15T18:20:51.000Z (about 3 years ago)
- Last Synced: 2024-08-04T02:06:34.228Z (5 months ago)
- Language: Python
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
- awesome-ovos-plugins - neon_utterance_postag_plugin - inject context (postag) (OPM plugins / Utterance Transformers)
README
```python
tagger = PosTagger()
_, context = tagger.transform(["o nome do meu cão é Jurebes VI, o temível"], {"lang": "pt"})
print(context)
# {'postag': {'universal': [[('o', 'DET'),
# ('nome', 'NOUN'),
# ('do', 'ADP'),
# ('meu', 'PRON'),
# ('cão', 'NOUN'),
# ('é', 'VERB'),
# ('Jurebes', 'NOUN'),
# ('VI', 'NOUN'),
# (',', '.'),
# ('o', 'DET'),
# ('temível', 'NOUN')]]}}# you can enable new tagsets or override models in .conf
# model_id from https://github.com/NeonJarbas/modelhub
# or full path to local file
tagger.load_models({
"en": {
"treebank": "nltk_treebank_perceptron_tagger", # extra tagsets can be added in .conf
"brown": "nltk_brown_perceptron_tagger" # the name can be anything, used as key of returned context
}
})
_, context = tagger.transform(["My name is Casimiro"])
print(context)
# {'postag': {'brown': [[('My', 'PP$'),
# ('name', 'NN'),
# ('is', 'BEZ'),
# ('Casimiro', 'NP-HL')]],
# 'treebank': [[('My', 'NNP'),
# ('name', 'NN'),
# ('is', 'VBZ'),
# ('Casimiro', 'NNP')]]}}
```