create README.md
Browse files## Model Description
This is a token classification model based on the GLiNER architecture, fine-tuned for recognizing various entity types from text. The model is trained on the OntoNotes 5 dataset and is designed to classify tokens into categories such as PERSON, ORG, DATE, and more.
## Intended Use
This model is intended for token classification tasks, particularly for named entity recognition (NER). It can be used to identify and classify entities in text, making it useful for information extraction, content tagging, and other NLP applications.
## Training Data
The model is fine-tuned on the OntoNotes 5 dataset, which provides annotated text data with various entity types. The dataset includes diverse examples of entities such as locations, organizations, dates, and other types of named entities.
## Usage
You can use the model for token classification as follows:
```python
from transformers import AutoTokenizer, AutoModelForTokenClassification
import torch
# Load the model and tokenizer
model_name = "your-username/gliner_model_name"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForTokenClassification.from_pretrained(model_name)
# Example usage
text = "Apple is looking at buying U.K. startup for $1 billion."
inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs)
# Post-processing to extract predictions
predictions = torch.argmax(outputs.logits, dim=2)
labels = tokenizer.convert_ids_to_tokens(predictions[0])
print(labels)
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
datasets:
|
4 |
+
- tner/ontonotes5
|
5 |
+
language:
|
6 |
+
- en
|
7 |
+
base_model: urchade/gliner_medium-v2.1
|
8 |
+
pipeline_tag: token-classification
|
9 |
+
library_name: transformers
|
10 |
+
tags:
|
11 |
+
- code
|
12 |
+
- finance
|
13 |
+
---
|