Skip to main content

Testing framework for sequence labeling

Project description


# 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
```


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

seqeval-0.0.3-py3-none-any.whl (5.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page