swarmauri_tool_entityrecognition 0.8.0.dev3__tar.gz → 0.8.0.dev5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {swarmauri_tool_entityrecognition-0.8.0.dev3 → swarmauri_tool_entityrecognition-0.8.0.dev5}/PKG-INFO +47 -18
- swarmauri_tool_entityrecognition-0.8.0.dev5/README.md +74 -0
- {swarmauri_tool_entityrecognition-0.8.0.dev3 → swarmauri_tool_entityrecognition-0.8.0.dev5}/pyproject.toml +13 -1
- swarmauri_tool_entityrecognition-0.8.0.dev3/README.md +0 -51
- {swarmauri_tool_entityrecognition-0.8.0.dev3 → swarmauri_tool_entityrecognition-0.8.0.dev5}/LICENSE +0 -0
- {swarmauri_tool_entityrecognition-0.8.0.dev3 → swarmauri_tool_entityrecognition-0.8.0.dev5}/swarmauri_tool_entityrecognition/EntityRecognitionTool.py +0 -0
- {swarmauri_tool_entityrecognition-0.8.0.dev3 → swarmauri_tool_entityrecognition-0.8.0.dev5}/swarmauri_tool_entityrecognition/__init__.py +0 -0
{swarmauri_tool_entityrecognition-0.8.0.dev3 → swarmauri_tool_entityrecognition-0.8.0.dev5}/PKG-INFO
RENAMED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: swarmauri_tool_entityrecognition
|
|
3
|
-
Version: 0.8.0.
|
|
3
|
+
Version: 0.8.0.dev5
|
|
4
4
|
Summary: Swarmauri Community Entity Recognition Tool
|
|
5
|
-
License: Apache-2.0
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Keywords: swarmauri,tool,entityrecognition,community,entity,recognition
|
|
6
8
|
Author: Jacob Stewart
|
|
7
9
|
Author-email: jacob@swarmauri.com
|
|
8
10
|
Requires-Python: >=3.10,<3.13
|
|
@@ -10,6 +12,10 @@ Classifier: License :: OSI Approved :: Apache Software License
|
|
|
10
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
11
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
12
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Natural Language :: English
|
|
16
|
+
Classifier: Development Status :: 3 - Alpha
|
|
17
|
+
Classifier: Intended Audience :: Developers
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
13
19
|
Requires-Dist: swarmauri_base
|
|
14
20
|
Requires-Dist: swarmauri_core
|
|
15
21
|
Requires-Dist: swarmauri_standard
|
|
@@ -18,8 +24,7 @@ Requires-Dist: tf-keras (==2.16.0)
|
|
|
18
24
|
Requires-Dist: transformers (>=4.45.0)
|
|
19
25
|
Description-Content-Type: text/markdown
|
|
20
26
|
|
|
21
|
-
|
|
22
|
-

|
|
27
|
+

|
|
23
28
|
|
|
24
29
|
<p align="center">
|
|
25
30
|
<a href="https://pypi.org/project/swarmauri_tool_entityrecognition/">
|
|
@@ -38,34 +43,58 @@ Description-Content-Type: text/markdown
|
|
|
38
43
|
|
|
39
44
|
# Swarmauri Tool Entity Recognition
|
|
40
45
|
|
|
41
|
-
|
|
46
|
+
Named-entity recognition tool for Swarmauri based on Hugging Face transformers. Uses the default `pipeline("ner")` model to detect tokens labeled as PERSON, ORG, LOC, etc., and returns a JSON-encoded dictionary of entities grouped by label.
|
|
47
|
+
|
|
48
|
+
## Features
|
|
49
|
+
|
|
50
|
+
- Wraps the transformers NER pipeline in a Swarmauri `ToolBase` component.
|
|
51
|
+
- Auto-downloads the default model on first run (usually `dslim/bert-base-NER`).
|
|
52
|
+
- Aggregates entity tokens by label and returns them as a JSON string in the `entities` key.
|
|
53
|
+
|
|
54
|
+
## Prerequisites
|
|
55
|
+
|
|
56
|
+
- Python 3.10 or newer.
|
|
57
|
+
- `transformers`, `torch`, and associated dependencies (installed automatically). Ensure GPU/CPU compatibility for PyTorch according to your environment.
|
|
58
|
+
- Internet access on first run to download model weights.
|
|
42
59
|
|
|
43
60
|
## Installation
|
|
44
61
|
|
|
45
62
|
```bash
|
|
63
|
+
# pip
|
|
46
64
|
pip install swarmauri_tool_entityrecognition
|
|
47
|
-
```
|
|
48
65
|
|
|
49
|
-
|
|
66
|
+
# poetry
|
|
67
|
+
poetry add swarmauri_tool_entityrecognition
|
|
50
68
|
|
|
51
|
-
|
|
69
|
+
# uv (pyproject-based projects)
|
|
70
|
+
uv add swarmauri_tool_entityrecognition
|
|
71
|
+
```
|
|
52
72
|
|
|
53
|
-
|
|
54
|
-
from swarmauri.tools.EntityRecognitionTool import EntityRecognitionTool
|
|
73
|
+
## Quickstart
|
|
55
74
|
|
|
56
|
-
|
|
57
|
-
|
|
75
|
+
```python
|
|
76
|
+
import json
|
|
77
|
+
from swarmauri_tool_entityrecognition import EntityRecognitionTool
|
|
58
78
|
|
|
59
|
-
# Example text for entity recognition
|
|
60
79
|
text = "Apple Inc. is an American multinational technology company."
|
|
61
|
-
|
|
62
|
-
# Get entities from the text
|
|
80
|
+
tool = EntityRecognitionTool()
|
|
63
81
|
result = tool(text=text)
|
|
64
82
|
|
|
65
|
-
|
|
66
|
-
print(
|
|
83
|
+
entities = json.loads(result["entities"])
|
|
84
|
+
print(entities)
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Example output:
|
|
88
|
+
```
|
|
89
|
+
{"B-ORG": ["Apple", "Inc."], "B-MISC": ["American"], "I-MISC": ["multinational"], ...}
|
|
67
90
|
```
|
|
68
91
|
|
|
92
|
+
## Tips
|
|
93
|
+
|
|
94
|
+
- The default pipeline tokenizes into subwords; reconstruct phrases by joining consecutive tokens with the same label when needed.
|
|
95
|
+
- Specify a different model by subclassing and passing `pipeline("ner", model="<model>")` if you require language-specific NER.
|
|
96
|
+
- Cache Hugging Face models (`HF_HOME`) in CI or container builds to avoid repeated downloads.
|
|
97
|
+
|
|
69
98
|
## Want to help?
|
|
70
99
|
|
|
71
100
|
If you want to contribute to swarmauri-sdk, read up on our [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/contributing.md) that will help you get started.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="https://pypi.org/project/swarmauri_tool_entityrecognition/">
|
|
5
|
+
<img src="https://img.shields.io/pypi/dm/swarmauri_tool_entityrecognition" alt="PyPI - Downloads"/></a>
|
|
6
|
+
<a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_tool_entityrecognition/">
|
|
7
|
+
<img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_tool_entityrecognition.svg"/></a>
|
|
8
|
+
<a href="https://pypi.org/project/swarmauri_tool_entityrecognition/">
|
|
9
|
+
<img src="https://img.shields.io/pypi/pyversions/swarmauri_tool_entityrecognition" alt="PyPI - Python Version"/></a>
|
|
10
|
+
<a href="https://pypi.org/project/swarmauri_tool_entityrecognition/">
|
|
11
|
+
<img src="https://img.shields.io/pypi/l/swarmauri_tool_entityrecognition" alt="PyPI - License"/></a>
|
|
12
|
+
<a href="https://pypi.org/project/swarmauri_tool_entityrecognition/">
|
|
13
|
+
<img src="https://img.shields.io/pypi/v/swarmauri_tool_entityrecognition?label=swarmauri_tool_entityrecognition&color=green" alt="PyPI - swarmauri_tool_entityrecognition"/></a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Swarmauri Tool Entity Recognition
|
|
19
|
+
|
|
20
|
+
Named-entity recognition tool for Swarmauri based on Hugging Face transformers. Uses the default `pipeline("ner")` model to detect tokens labeled as PERSON, ORG, LOC, etc., and returns a JSON-encoded dictionary of entities grouped by label.
|
|
21
|
+
|
|
22
|
+
## Features
|
|
23
|
+
|
|
24
|
+
- Wraps the transformers NER pipeline in a Swarmauri `ToolBase` component.
|
|
25
|
+
- Auto-downloads the default model on first run (usually `dslim/bert-base-NER`).
|
|
26
|
+
- Aggregates entity tokens by label and returns them as a JSON string in the `entities` key.
|
|
27
|
+
|
|
28
|
+
## Prerequisites
|
|
29
|
+
|
|
30
|
+
- Python 3.10 or newer.
|
|
31
|
+
- `transformers`, `torch`, and associated dependencies (installed automatically). Ensure GPU/CPU compatibility for PyTorch according to your environment.
|
|
32
|
+
- Internet access on first run to download model weights.
|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# pip
|
|
38
|
+
pip install swarmauri_tool_entityrecognition
|
|
39
|
+
|
|
40
|
+
# poetry
|
|
41
|
+
poetry add swarmauri_tool_entityrecognition
|
|
42
|
+
|
|
43
|
+
# uv (pyproject-based projects)
|
|
44
|
+
uv add swarmauri_tool_entityrecognition
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Quickstart
|
|
48
|
+
|
|
49
|
+
```python
|
|
50
|
+
import json
|
|
51
|
+
from swarmauri_tool_entityrecognition import EntityRecognitionTool
|
|
52
|
+
|
|
53
|
+
text = "Apple Inc. is an American multinational technology company."
|
|
54
|
+
tool = EntityRecognitionTool()
|
|
55
|
+
result = tool(text=text)
|
|
56
|
+
|
|
57
|
+
entities = json.loads(result["entities"])
|
|
58
|
+
print(entities)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Example output:
|
|
62
|
+
```
|
|
63
|
+
{"B-ORG": ["Apple", "Inc."], "B-MISC": ["American"], "I-MISC": ["multinational"], ...}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Tips
|
|
67
|
+
|
|
68
|
+
- The default pipeline tokenizes into subwords; reconstruct phrases by joining consecutive tokens with the same label when needed.
|
|
69
|
+
- Specify a different model by subclassing and passing `pipeline("ner", model="<model>")` if you require language-specific NER.
|
|
70
|
+
- Cache Hugging Face models (`HF_HOME`) in CI or container builds to avoid repeated downloads.
|
|
71
|
+
|
|
72
|
+
## Want to help?
|
|
73
|
+
|
|
74
|
+
If you want to contribute to swarmauri-sdk, read up on our [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/contributing.md) that will help you get started.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "swarmauri_tool_entityrecognition"
|
|
3
|
-
version = "0.8.0.
|
|
3
|
+
version = "0.8.0.dev5"
|
|
4
4
|
description = "Swarmauri Community Entity Recognition Tool"
|
|
5
5
|
license = "Apache-2.0"
|
|
6
6
|
readme = "README.md"
|
|
@@ -11,6 +11,10 @@ classifiers = [
|
|
|
11
11
|
"Programming Language :: Python :: 3.10",
|
|
12
12
|
"Programming Language :: Python :: 3.11",
|
|
13
13
|
"Programming Language :: Python :: 3.12",
|
|
14
|
+
"Natural Language :: English",
|
|
15
|
+
"Development Status :: 3 - Alpha",
|
|
16
|
+
"Intended Audience :: Developers",
|
|
17
|
+
"Topic :: Software Development :: Libraries :: Application Frameworks",
|
|
14
18
|
]
|
|
15
19
|
authors = [{ name = "Jacob Stewart", email = "jacob@swarmauri.com" }]
|
|
16
20
|
dependencies = [
|
|
@@ -21,6 +25,14 @@ dependencies = [
|
|
|
21
25
|
"swarmauri_base",
|
|
22
26
|
"swarmauri_standard",
|
|
23
27
|
]
|
|
28
|
+
keywords = [
|
|
29
|
+
"swarmauri",
|
|
30
|
+
"tool",
|
|
31
|
+
"entityrecognition",
|
|
32
|
+
"community",
|
|
33
|
+
"entity",
|
|
34
|
+
"recognition",
|
|
35
|
+
]
|
|
24
36
|
|
|
25
37
|
[tool.uv.sources]
|
|
26
38
|
swarmauri_core = { workspace = true }
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-

|
|
3
|
-
|
|
4
|
-
<p align="center">
|
|
5
|
-
<a href="https://pypi.org/project/swarmauri_tool_entityrecognition/">
|
|
6
|
-
<img src="https://img.shields.io/pypi/dm/swarmauri_tool_entityrecognition" alt="PyPI - Downloads"/></a>
|
|
7
|
-
<a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_tool_entityrecognition/">
|
|
8
|
-
<img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_tool_entityrecognition.svg"/></a>
|
|
9
|
-
<a href="https://pypi.org/project/swarmauri_tool_entityrecognition/">
|
|
10
|
-
<img src="https://img.shields.io/pypi/pyversions/swarmauri_tool_entityrecognition" alt="PyPI - Python Version"/></a>
|
|
11
|
-
<a href="https://pypi.org/project/swarmauri_tool_entityrecognition/">
|
|
12
|
-
<img src="https://img.shields.io/pypi/l/swarmauri_tool_entityrecognition" alt="PyPI - License"/></a>
|
|
13
|
-
<a href="https://pypi.org/project/swarmauri_tool_entityrecognition/">
|
|
14
|
-
<img src="https://img.shields.io/pypi/v/swarmauri_tool_entityrecognition?label=swarmauri_tool_entityrecognition&color=green" alt="PyPI - swarmauri_tool_entityrecognition"/></a>
|
|
15
|
-
</p>
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
# Swarmauri Tool Entity Recognition
|
|
20
|
-
|
|
21
|
-
A Swarmauri tool that extracts named entities from text using a pre-trained NLP model.
|
|
22
|
-
|
|
23
|
-
## Installation
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
pip install swarmauri_tool_entityrecognition
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## Usage
|
|
30
|
-
|
|
31
|
-
Here's a basic example of how to use the Entity Recognition Tool:
|
|
32
|
-
|
|
33
|
-
```python
|
|
34
|
-
from swarmauri.tools.EntityRecognitionTool import EntityRecognitionTool
|
|
35
|
-
|
|
36
|
-
# Initialize the tool
|
|
37
|
-
tool = EntityRecognitionTool()
|
|
38
|
-
|
|
39
|
-
# Example text for entity recognition
|
|
40
|
-
text = "Apple Inc. is an American multinational technology company."
|
|
41
|
-
|
|
42
|
-
# Get entities from the text
|
|
43
|
-
result = tool(text=text)
|
|
44
|
-
|
|
45
|
-
# The result will contain entities in JSON format
|
|
46
|
-
print(result["entities"])
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## Want to help?
|
|
50
|
-
|
|
51
|
-
If you want to contribute to swarmauri-sdk, read up on our [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/contributing.md) that will help you get started.
|
{swarmauri_tool_entityrecognition-0.8.0.dev3 → swarmauri_tool_entityrecognition-0.8.0.dev5}/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|