Skip to main content

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


Download files

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

Source Distribution

acs_classifex-0.1.0.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

acs_classifex-0.1.0-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

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

Hashes for acs_classifex-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7aa3b10f53413fbbabb9879b1c2a4d6c97ca5a6232fe4b9279b6cbb1cd8df3dd
MD5 6959bf297864778f053a6fb91dd6dbb4
BLAKE2b-256 b2ca178dc35005d1b7ed63ea9376e58e91430eed34b2bb2986e7f8d5360caddf

See more details on using hashes here.

File details

Details for the file acs_classifex-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for acs_classifex-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d387719c4396d9cf6efd9d38a872dfe4cecf83c851c43c2535527c548993822
MD5 bf0c87dfbf347c73fa80fc3e42749ace
BLAKE2b-256 7e5ca902349f96e0ae8f19e15d3a4902cf5b20fcd15be3287122f2bffe1ba7ec

See more details on using hashes here.

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