GLiNER2
Safetensors
ner
relation-extraction
data-mention-extraction
lora
development-economics
geography
Instructions to use ai4data/datause-extraction-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- GLiNER2
How to use ai4data/datause-extraction-v1 with GLiNER2:
from gliner2 import AutoExtractor extractor = AutoExtractor.from_pretrained("ai4data/datause-extraction-v1") # Extract entities text = "Apple CEO Tim Cook announced iPhone 15 in Cupertino yesterday." result = extractor.extract_entities(text, ["company", "person", "product", "location"]) print(result) - Notebooks
- Google Colab
- Kaggle
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -48,13 +48,13 @@ It is **highly recommended** to interact with this model using the official **`a
|
|
| 48 |
Install the library directly from GitHub:
|
| 49 |
|
| 50 |
```bash
|
| 51 |
-
pip install git+https://github.com/
|
| 52 |
```
|
| 53 |
|
| 54 |
### 1. Extract from Text
|
| 55 |
|
| 56 |
```python
|
| 57 |
-
from ai4data import extract_from_text
|
| 58 |
|
| 59 |
text = """
|
| 60 |
We use the 2022 Demographic and Health Survey (DHS) conducted by the National Statistics Office in Uganda
|
|
@@ -77,7 +77,7 @@ for dataset in results["datasets"]:
|
|
| 77 |
### 2. Extract from PDF
|
| 78 |
|
| 79 |
```python
|
| 80 |
-
from ai4data import extract_from_document
|
| 81 |
|
| 82 |
# Extracts from a local path or a PDF URL
|
| 83 |
pdf_url = "https://pdf.usaid.gov/pdf_docs/PA00TB5D.pdf"
|
|
|
|
| 48 |
Install the library directly from GitHub:
|
| 49 |
|
| 50 |
```bash
|
| 51 |
+
pip install git+https://github.com/worldbank/ai4data.git
|
| 52 |
```
|
| 53 |
|
| 54 |
### 1. Extract from Text
|
| 55 |
|
| 56 |
```python
|
| 57 |
+
from ai4data.data_use import extract_from_text
|
| 58 |
|
| 59 |
text = """
|
| 60 |
We use the 2022 Demographic and Health Survey (DHS) conducted by the National Statistics Office in Uganda
|
|
|
|
| 77 |
### 2. Extract from PDF
|
| 78 |
|
| 79 |
```python
|
| 80 |
+
from ai4data.data_use import extract_from_document
|
| 81 |
|
| 82 |
# Extracts from a local path or a PDF URL
|
| 83 |
pdf_url = "https://pdf.usaid.gov/pdf_docs/PA00TB5D.pdf"
|