tagme-python
Official TagMe API wrapper for Python.
Installation and setup
This library is hosted by PyPI. You can install it with:
pip install tagme
To access the TagMe API you have to register (for free!) at the D4Science platform and obtain an authorization token.
Register to the D4Science TagMe VRE.
After login, click the show button on the left panel to get your authorization token.
Using TagMe
Before making any call to the web service, you will need to set the module-wise GCUBE_TOKEN variable. You can do so with:
import tagme
# Set the authorization token for subsequent calls.
tagme.GCUBE_TOKEN = "<Your token goes here>"
As an alternative to setting the module-wise variable, you can pass the token at each call with the optional gcube_token parameter.
Annotation
The annotation service lets you find entities mentioned in a text and link them to Wikipedia. This is the so-called Sa2KB problem. You can annotate a text with:
lunch_annotations = tagme.annotate("My favourite meal is Mexican burritos.")
# Print annotations with a score higher than 0.1
for ann in lunch_annotations.get_annotations(0.1):
print ann
The annotate method accepts parameters to set the language (parameter lang, that defaults to en) and other stuff. See the code for more information. Annotations are associated a rho-score indicating the likelihood of an annotation being correct. In the example, we discard annotations with a score lower than 0.1.
Mention finding
The mention finding service lets you find what parts of text may be a mention of an entity, without linking them to any entity.
tomatoes_mentions = tagme.mentions("I definitely like ice cream better than tomatoes.")
for mention in tomatoes_mentions.mentions:
print mention
The mentions parameter accepts an optional language parameter lang that defaults to en.
Changelog
See the Changelog.
Metadata
Release files for tagme 0.1.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 | Provenance | Actions |
|---|---|---|---|---|
| tagme-0.1.3.tar.gz | 5.7 kB | Without provenance | Details for tagme-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tagme-0.1.3-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for tagme-0.1.3-py2.py3-none-any.whl |
Total release size: 13.9 kB
Release files / tagme-0.1.3.tar.gz
| Download URL | tagme-0.1.3.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1cf4fc57bc5443ab595ba6c82178f42cedac07ab6b068e5ba1a4242b147b0df6
|
|
BLAKE2b-256 checksum How to use checksums |
22841b2700d452518ebec12161289b4e67df2fc1769f11bcde323d654e374029
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / tagme-0.1.3-py2.py3-none-any.whl
| Download URL | tagme-0.1.3-py2.py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
ca0e54058e050c1d48f6a0a90b2b5e9916c60cd51d1b70e0a4418ce439c27dab
|
|
BLAKE2b-256 checksum How to use checksums |
7beabbdb46fec64423ea0b28fd508ab8ee8b59a918db090d5e073dd6f3bf227f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for tagme 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.