spaCy wrapper for Diffbot Natural Language API
Extracts entities (e.g., people, organizations, locations) and facts about these entities from natural language text using Diffbot's natural language api (https://diffbot.com/products/natural-language/)
Installation
pip install spacy-diffbot-nlapi
Usage
import spacy
import spacy_diffbot_nlapi
nlp = spacy.blank("en")
nlp.add_pipe("diffbot", config={"token":DIFFBOT_TOKEN, "lang":"en", "concurrent_connections":10})
texts = [
"Mike Tung is the founder and CEO of Diffbot. He is also an adviser at the StartX accelerator, and the leader of Stanford's entry in the DARPA Robotics Challenge. In a previous life, he was a grad student in the Stanford AI Lab, and a software engineer at eBay, Yahoo, and Microsoft. Tung studied electrical engineering and computer science at UC Berkeley and artificial intelligence at Stanford.",
"Apple Inc. is an American multinational technology company headquartered in Cupertino, California, that designs, develops, and sells consumer electronics, computer software, and online services.",
"Facebook (FB) said Friday that it had acquired Giphy, a popular search engine for short, looping videos and animations called GIFs. The service will become part of Facebook's Instagram team, making it easier for people to find relevant GIFs for their Stories and direct messages.",
]
for doc in nlp.pipe(texts):
print(doc)
for ent in doc.ents:
print(f'{ent.text:>25}\t\t{ent.label_:>15}\t{ent.kb_id_:>25}\t{ent._.uris}')
Learn more
Metadata
Release files for spacy-diffbot-nlapi 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| spacy-diffbot-nlapi-1.1.0.tar.gz | 3.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| spacy_diffbot_nlapi-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.8 kB
Release files / spacy-diffbot-nlapi-1.1.0.tar.gz
| Download URL | spacy-diffbot-nlapi-1.1.0.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bd68e1fb9e77ec199c18e322eb0a68e08689adaa74396dd57cd8f53c3890c94c
|
|
BLAKE2b-256 checksum How to use checksums |
be2caa47dd971fc15e137c388df6cf45bf95c36f24e070e55ecb9e20b68d0ea5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.6.13
|
Release files / spacy_diffbot_nlapi-1.1.0-py3-none-any.whl
| Download URL | spacy_diffbot_nlapi-1.1.0-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
54815172e0c5fd1601aa8c8d8c6b51f5a67bd5e7db3d9e771df8f82f4196081b
|
|
BLAKE2b-256 checksum How to use checksums |
7e0dd9173e341685c8cbbb28d503cbb98720fff569bdce5cef99e7797746cf2a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.6.13
|