ner_analyzer_cli_v2
A simple Named Entity Recognition (NER) analyzer package with a command-line interface (CLI) and export options for JSON and CSV. Powered by spaCy and supporting multiple languages.
Features
- Analyze text for named entities using spaCy.
- Supports multiple languages (
en,fr,de,es,pt). - Export results to JSON or CSV files.
- Shows entity frequency statistics.
- Easy-to-use CLI interface.
Installation
First, install the package (after cloning or downloading):
pip install ner_analyzer_cli_v2
You must also download the relevant spaCy language model(s) as needed. For example:
python -m spacy download en_core_web_sm
python -m spacy download fr_core_news_sm
# For other languages, see: https://spacy.io/models
CLI Usage
ner-analyze "Your text to analyze here"
Options
--output <file>: Specify output file (.jsonor.csv).--lang <code>: Specify language code (en,fr,de,es,pt). Default isen.
Example
Analyze some text and export results:
ner-analyze "Barack Obama was born in Hawaii." --output results.json
ner-analyze "Emmanuel Macron est le président français." --lang fr --output results.csv
Output Example
Console
Entities:
[
{
"text": "Barack Obama",
"label": "PERSON"
},
{
"text": "Hawaii",
"label": "GPE"
}
]
Frequency:
{'PERSON': 1, 'GPE': 1}
JSON
{
"entities": [
{"text": "Barack Obama", "label": "PERSON"},
{"text": "Hawaii", "label": "GPE"}
],
"frequency": {"PERSON": 1, "GPE": 1}
}
CSV
Entity,Label
Barack Obama,PERSON
Hawaii,GPE
Label,Count
PERSON,1
GPE,1
API Usage
You can also use the NERAnalyzer class directly in your Python scripts:
from ner_analyzer.cli import NERAnalyzer
analyzer = NERAnalyzer(lang_model="en_core_web_sm")
entities = analyzer.analyze_text("Angela Merkel was Chancellor of Germany.")
print(entities)
License
MIT License
Author
Metadata
Release files for ner-analyzer-cli-v2 0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ner_analyzer_cli_v2-0.3.tar.gz | 3.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ner_analyzer_cli_v2-0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.4 kB
Release files / ner_analyzer_cli_v2-0.3.tar.gz
| Download URL | ner_analyzer_cli_v2-0.3.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
21a6ec44d73d8931ab12db4b7ee53828224b5edde375fb9b6ff6d39770bfab98
|
|
BLAKE2b-256 checksum How to use checksums |
76eba91ab19c722d93cade8b5ade68b25dc0ef9540e2d57053f962ae2b0407f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / ner_analyzer_cli_v2-0.3-py3-none-any.whl
| Download URL | ner_analyzer_cli_v2-0.3-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7f33a0e33af417619bcadcf788b70f19949c7673ecdb7257a38b6c27ac283e50
|
|
BLAKE2b-256 checksum How to use checksums |
9127e278e72c6239ac4734af0eb98a4e95f20cbc640bd56feaba3e9a94c2d63c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|