A Python package for training a custom NER model using spaCy
Project description
acs_classifex
This package provides utilities to train and load a custom Named Entity Recognition (NER) model using spaCy.
Installation
pip install acs_classifex
Usage
from acs_classifex import train_ner, load_model
Training data format: [(text, {'entities': [(start, end, label)]})]
training_data = [ ("Apple is looking at buying U.K. startup for $1 billion", {'entities': [(0, 5, 'ORG'), (27, 31, 'GPE'), (44, 54, 'MONEY')]}), ("San Francisco is a beautiful city", {'entities': [(0, 13, 'GPE')]}) ]
Train the NER model
train_ner(training_data)
Load the trained model
nlp = loadmodel() doc = nlp("Apple is acquiring a company in London") print([(ent.text, ent.label) for ent in doc.ents])
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
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 acs_classifex-0.1.0.tar.gz.
File metadata
- Download URL: acs_classifex-0.1.0.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7aa3b10f53413fbbabb9879b1c2a4d6c97ca5a6232fe4b9279b6cbb1cd8df3dd
|
|
| MD5 |
6959bf297864778f053a6fb91dd6dbb4
|
|
| BLAKE2b-256 |
b2ca178dc35005d1b7ed63ea9376e58e91430eed34b2bb2986e7f8d5360caddf
|
File details
Details for the file acs_classifex-0.1.0-py3-none-any.whl.
File metadata
- Download URL: acs_classifex-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d387719c4396d9cf6efd9d38a872dfe4cecf83c851c43c2535527c548993822
|
|
| MD5 |
bf0c87dfbf347c73fa80fc3e42749ace
|
|
| BLAKE2b-256 |
7e5ca902349f96e0ae8f19e15d3a4902cf5b20fcd15be3287122f2bffe1ba7ec
|