A lightweight Linear-Chain Conditional Random Field
Project description
A lightweight Linear-Chain Conditional Random Field
This is a modern, fast and no-dependency Python library implementing a linear-chain conditional random field for natural language processing tasks like named entity recognition or part-of-speech tagging.
Installation
You can install the latest stable version from PyPI:
$ pip install chaine
Example
>>> import chaine
>>> import datasets
>>> data = datasets.load_dataset("germeval_14")
>>> tokens = data["train"]["tokens"]
>>> labels = data["train"]["ner_tags"]
>>> crf = chaine.train(tokens, labels, max_iterations=100)
>>> sequence = chaine.featurize(["todo", "todo", "todo"])
>>> crf.predict(sequence)
["O", "O", "B-PER"]
Disclaimer
This library makes use of and is partially based on:
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
chaine-0.1.0.tar.gz
(7.8 kB
view hashes)
Built Distributions
Close
Hashes for chaine-0.1.0-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5422422e5894db6cbaa4db4f1ae03dae0befe3bcc1b36e21294e9cb8035fbb2e |
|
MD5 | 2d6bb7fe3a6a96278f50cc21db19cec6 |
|
BLAKE2b-256 | 0c36f44c76ffd3ac3e38105ee3b977ad58c6470913faba06780e092610c38851 |
Close
Hashes for chaine-0.1.0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a6ccfcb4039a710d7a7c2a82cc325a715c72ddd8d4cc712c6dda11c9377b8ca |
|
MD5 | e55c566a87a65b11c6dc515d55db9dbd |
|
BLAKE2b-256 | de6ff10b6386b9d0b9b3030d2f4eb04cf154f44402197220ef8ceaabbdbca01c |