Spaces:
Runtime error
Runtime error
mwitiderrick
commited on
Commit
·
c4a60b7
1
Parent(s):
2b76624
Update app.py
Browse files
app.py
CHANGED
@@ -8,9 +8,11 @@ Named Entity Recognition is the task of extracting and locating named entities i
|
|
8 |
![Named Entity Recognition Pipeline with DeepSparse](https://huggingface.co/spaces/neuralmagic/nlp-ner/resolve/main/named.png)
|
9 |
|
10 |
## What is DeepSparse?
|
11 |
-
DeepSparse is
|
12 |
-
|
13 |
-
|
|
|
|
|
14 |
Here is sample code for a token classification pipeline:
|
15 |
```python
|
16 |
from deepsparse import Pipeline
|
@@ -18,10 +20,11 @@ pipeline = Pipeline.create(task="ner", model_path="zoo:nlp/token_classification/
|
|
18 |
inference = pipeline(text)
|
19 |
print(inference)
|
20 |
```
|
21 |
-
## Use
|
22 |
The Named Entity Recognition Pipeline can process text before storing the information in a database.
|
23 |
For example, you may want to process text and store the entities in different columns depending on the entity type.
|
24 |
|
|
|
25 |
'''
|
26 |
task = "ner"
|
27 |
dense_qa_pipeline = Pipeline.create(
|
|
|
8 |
![Named Entity Recognition Pipeline with DeepSparse](https://huggingface.co/spaces/neuralmagic/nlp-ner/resolve/main/named.png)
|
9 |
|
10 |
## What is DeepSparse?
|
11 |
+
DeepSparse is an inference runtime offering GPU-class performance on CPUs and APIs to integrate ML into your application. Sparsification is a powerful technique for optimizing models for inference, reducing the compute needed with a limited accuracy tradeoff. DeepSparse is designed to take advantage of model sparsity, enabling you to deploy models with the flexibility and scalability of software on commodity CPUs with the best-in-class performance of hardware accelerators, enabling you to standardize operations and reduce infrastructure costs.
|
12 |
+
Similar to Hugging Face, DeepSparse provides off-the-shelf pipelines for computer vision and NLP that wrap the model with proper pre- and post-processing to run performantly on CPUs by using sparse models.
|
13 |
+
|
14 |
+
SparseML Named Entity Recognition Pipelines integrate with Hugging Face’s Transformers library to enable the sparsification of a large set of transformers models.
|
15 |
+
### Inference API Example
|
16 |
Here is sample code for a token classification pipeline:
|
17 |
```python
|
18 |
from deepsparse import Pipeline
|
|
|
20 |
inference = pipeline(text)
|
21 |
print(inference)
|
22 |
```
|
23 |
+
## Use Case Description
|
24 |
The Named Entity Recognition Pipeline can process text before storing the information in a database.
|
25 |
For example, you may want to process text and store the entities in different columns depending on the entity type.
|
26 |
|
27 |
+
[Want to train a sparse model on your data? Checkout the documentation on sparse transfer learning](https://docs.neuralmagic.com/use-cases/natural-language-processing/question-answering)
|
28 |
'''
|
29 |
task = "ner"
|
30 |
dense_qa_pipeline = Pipeline.create(
|