huggingfaceinference
Simple inference pipelines using hugging transformers library and finetuned tiny models. Will be highly useful on scenarios where we need to optimize storage and memory cost with a compensation in accuracy.
Installation
pip install huggingfaceinference
Implementation
TinyGram
A simple grammatical and spelling resolver using huggingface transformers. The Dataset (around 50k) is retrieved from kaggle and corrupted using random substution of letters in words for finetuning. The base model used was google/t5-efficient-tiny-nl32 as it is highly compact and efficient(<250 MB).(was modeled on fp32 to reduce drop in efficiency).
from huggingfaceinference.pipeline import TinyGram
tg = TinyGram()
tg.gramcorrector("What do you think I shold be doing", n=3)
""" Output: ['What do you think I need to be doing',
'what do you think I should be doing',
'what do you think I will be doing']"""
# The above pipeline is built by finetuing "google/t5-efficient-tiny-nl32" model on sentences which are corrupted by random noising.
Knowledge Graph
A simple tool to create knowledge graphs in NLP using a pre-trained model modelled on custom dataset created using spaCy library.
from huggingfaceinference.pipeline import KnowledgeGraph
kg = KnowledgeGraph()
kg.get_graph(text)
""" [{'tend': 'O'},
{'##ul': 'SRC'},
{'##kar': 'SRC'},
{'plays': 'SRC'},
{'for': 'REL'},
{'india': 'REL'}]"""
# The above pipeline is built by finetuing "google/t5-efficient-tiny-nl32" model on sentences which are corrupted by random noising.
Metadata
Release files for huggingfaceinference 0.9
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 |
|---|---|---|---|---|
| huggingfaceinference-0.9.tar.gz | 5.9 kB | Without provenance | Details for huggingfaceinference-0.9.tar.gz |
Release files / huggingfaceinference-0.9.tar.gz
| Download URL | huggingfaceinference-0.9.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
504e1cd20ac430bce552d4c7efcd15f18490c58381df9783592da553c11accea
|
|
BLAKE2b-256 checksum How to use checksums |
5baeca0367f189a80c064148b0d1600641d1e380d3809fe969f288e6e2471e2f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.1
|
Security for huggingfaceinference 0.9
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.