PosLog: A CRF-based Part-of-Speech Tagger for Log Messages
Project description
PosLog
A CRF-based Part-of-Speech (POS) Tagger for Log Messages.
Usage
-
Use default model
from nlp import PrometeusTokenizer from nlp.pos import PosLogCRF tokenizer=PrometeusTokenizer() s="Tag this sentence." tokens=tokenizer.tokenize(s) # ['Tag', 'this', 'sentence', '.'] pos_log=PosLogCRF() pos_log.predict(tokens) # ['VERB' 'DET' 'NOUN' 'PUNCT']
-
Train your own model
Define model name in constructor:pos_log=PosLogCRF(model_name="my_model")
PosLog takes training data as tokens and tags separately:
train(X_train_tokens:list[list[str]], y_train_tags:list[list[str]])
Or as token and tag pairs:
train_from_tagged_sents(tagged_sents:list[list[tuple[str,str]]])
Note training will override existing model with the same name.
-
Use your own model
Just call the constructor with the model name:pos_log=PosLogCRF(model_name="my_model")
Dependencies
PosLog relies on nltk corpora: words, stopwords, wordnet.
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
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 poslog-0.2.tar.gz.
File metadata
- Download URL: poslog-0.2.tar.gz
- Upload date:
- Size: 456.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
313b1e0aeff69dd6934841495a9df58fe29f3ebdcb2df55e5278ff323c23525a
|
|
| MD5 |
28198a6c1f7f66c87b4718279e5a61d3
|
|
| BLAKE2b-256 |
95511fc0ac32aa440232dd655d76c3f42269f2f5348a011c1d8a22cd51b05945
|
File details
Details for the file poslog-0.2-py3-none-any.whl.
File metadata
- Download URL: poslog-0.2-py3-none-any.whl
- Upload date:
- Size: 454.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ceeef1e07808571a0d8c8629076aed8482895fe5909336f453931bfb1306bd08
|
|
| MD5 |
a7f7ed147010d6fc98e0beaab71936b9
|
|
| BLAKE2b-256 |
e37e556b72e94e87962ca52592f4e5ecb0bebc84c0864e73125b91c6ea713fb4
|