text
We are super happy to contribute to the GLiNER ecosystem by optimizing training code and releasing a multi-task, prompt-tunable model.
We are super happy to contribute to the GLiNER ecosystem by optimizing training code and releasing a multi-task, prompt-tunable model.
new_line
new_line
text
The model can be used for the following tasks:
The model can be used for the following tasks:
new_line
text
* Named entity recognition (NER);
* Named entity recognition (NER);
new_line
text
* Open information extraction;
* Open information extraction;
new_line
text
* Question answering;
* Question answering;
new_line
text
* Relation extraction;
* Relation extraction;
new_line
text
* Summarization;
* Summarization;
new_line
new_line
text
Model: 
Model: 
resource
https://huggingface.co/knowledgator/gliner-multitask-large-v0.5
model
knowledgator/gliner-multitask-large-v0.5
https://huggingface.co/knowledgator/gliner-multitask-large-v0.5
new_line
text
Demo: 
Demo: 
resource
https://huggingface.co/spaces/knowledgator/GLiNER_HandyLab
space
knowledgator/GLiNER_HandyLab
https://huggingface.co/spaces/knowledgator/GLiNER_HandyLab
new_line
text
Repo: 👨‍💻 
Repo: 👨‍💻 
link
https://github.com/urchade/GLiNER
https://github.com/urchade/GLiNER
new_line
new_line
text
**How to use**
**How to use**
new_line
text
First of all, install gliner package.
First of all, install gliner package.
new_line
new_line
code_fence
```bash
pip install gliner
```
pip install gliner
bash
new_line
text
Then try the following code:
Then try the following code:
new_line
code_fence
```python
from gliner import GLiNER

model = GLiNER.from_pretrained("knowledgator/gliner_small-v2.1")

prompt = """Find all positive aspects about the product:\n"""
text = """
I recently purchased the Sony WH-1000XM4 Wireless Noise-Canceling Headphones from Amazon and I must say, I'm thoroughly impressed. The package arrived in New York within 2 days, thanks to Amazon Prime's expedited shipping.

The headphones themselves are remarkable. The noise-canceling feature works like a charm in the bustling city environment, and the 30-hour battery life means I don't have to charge them every day. Connecting them to my Samsung Galaxy S21 was a breeze, and the sound quality is second to none.
I also appreciated the customer service from Amazon when I had a question about the warranty. They responded within an hour and provided all the information I needed.
However, the headphones did not come with a hard case, which was listed in the product description. I contacted Amazon, and they offered a 10% discount on my next purchase as an apology.
Overall, I'd give these headphones a 4.5/5 rating and highly recommend them to anyone looking for top-notch quality in both product and service.
"""
input_ = prompt+text

labels = ["match"]

matches = model.predict_entities(input_, labels)

for match in matches:
    print(match["text"], "=>", match["score"])
```
from gliner import GLiNER

model = GLiNER.from_pretrained("knowledgator/gliner_small-v2.1")

prompt = """Find all positive aspects about the product:\n"""
text = """
I recently purchased the Sony WH-1000XM4 Wireless Noise-Canceling Headphones from Amazon and I must say, I'm thoroughly impressed. The package arrived in New York within 2 days, thanks to Amazon Prime's expedited shipping.

The headphones themselves are remarkable. The noise-canceling feature works like a charm in the bustling city environment, and the 30-hour battery life means I don't have to charge them every day. Connecting them to my Samsung Galaxy S21 was a breeze, and the sound quality is second to none.
I also appreciated the customer service from Amazon when I had a question about the warranty. They responded within an hour and provided all the information I needed.
However, the headphones did not come with a hard case, which was listed in the product description. I contacted Amazon, and they offered a 10% discount on my next purchase as an apology.
Overall, I'd give these headphones a 4.5/5 rating and highly recommend them to anyone looking for top-notch quality in both product and service.
"""
input_ = prompt+text

labels = ["match"]

matches = model.predict_entities(input_, labels)

for match in matches:
    print(match["text"], "=>", match["score"])
python
new_line
We are super happy to contribute to the GLiNER ecosystem by optimizing training code and releasing a multi-task, prompt-tunable model.

The model can be used for the following tasks:
* Named entity recognition (NER);
* Open information extraction;
* Question answering;
* Relation extraction;
* Summarization;

Model: https://huggingface.co/knowledgator/gliner-multitask-large-v0.5
Demo: https://huggingface.co/spaces/knowledgator/GLiNER_HandyLab
Repo: 👨‍💻 https://github.com/urchade/GLiNER

**How to use**
First of all, install gliner package.

```bash
pip install gliner
```
Then try the following code:
```python
from gliner import GLiNER

model = GLiNER.from_pretrained("knowledgator/gliner_small-v2.1")

prompt = """Find all positive aspects about the product:\n"""
text = """
I recently purchased the Sony WH-1000XM4 Wireless Noise-Canceling Headphones from Amazon and I must say, I'm thoroughly impressed. The package arrived in New York within 2 days, thanks to Amazon Prime's expedited shipping.

The headphones themselves are remarkable. The noise-canceling feature works like a charm in the bustling city environment, and the 30-hour battery life means I don't have to charge them every day. Connecting them to my Samsung Galaxy S21 was a breeze, and the sound quality is second to none.
I also appreciated the customer service from Amazon when I had a question about the warranty. They responded within an hour and provided all the information I needed.
However, the headphones did not come with a hard case, which was listed in the product description. I contacted Amazon, and they offered a 10% discount on my next purchase as an apology.
Overall, I'd give these headphones a 4.5/5 rating and highly recommend them to anyone looking for top-notch quality in both product and service.
"""
input_ = prompt+text

labels = ["match"]

matches = model.predict_entities(input_, labels)

for match in matches:
    print(match["text"], "=>", match["score"])
```
