# seqeval
seqeval is a testing framework for sequence labeling.
You can evaluate named-entity recognition, part-of-speech tagging, semantic role labeling and so on.
seqeval supports following format:
* IOB
* IOBES
## How to use
Behold, the power of seqeval:
```python
>>> from seqeval.metrics import f1_score, accuracy_score, classification_report
>>> y_true = ['O', 'O', 'O', 'B-MISC', 'I-MISC', 'I-MISC', 'O', 'B-PER', 'I-PER']
>>> y_pred = ['O', 'O', 'B-MISC', 'I-MISC', 'I-MISC', 'I-MISC', 'O', 'B-PER', 'I-PER']
>>> f1_score(y_true, y_pred)
0.50
>>> accuracy_score(y_true, y_pred)
0.50
>>> classification_report(y_true, y_pred)
precision recall f1-score support
MISC 0.00 0.00 0.00 1
PER 1.00 1.00 1.00 1
avg / total 0.50 0.50 0.50 2
```
You can fed a nested list into the functions:
```python
>>> y_true = [['O', 'O', 'O', 'B-MISC', 'I-MISC', 'I-MISC', 'O'], ['B-PER', 'I-PER']]
>>> y_pred = [['O', 'O', 'B-MISC', 'I-MISC', 'I-MISC', 'I-MISC', 'O'], ['B-PER', 'I-PER']]
>>> f1_score(y_true, y_pred)
0.50
```
## Install
To install seqeval, simply run:
```
$ pip install seqeval
```
Release files for seqeval 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| seqeval-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Release files / seqeval-0.0.2-py3-none-any.whl
| Download URL | seqeval-0.0.2-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0ee060ac6f434cd01a85d00d0fab6e5eca98ea59d75c0f8740434ce86b92e727
|
|
BLAKE2b-256 checksum How to use checksums |
ffd8c07642cc78c2cf4d313dae024fac521df8fbd62f00ddc69cad5a42c27c33
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |