|
--- |
|
language: |
|
- it |
|
pipeline_tag: text-generation |
|
license: llama3 |
|
--- |
|
|
|
# SLIMER-IT: Show Less Instruct More Entity Recognition - Italian language |
|
|
|
SLIMER-IT is an LLM specifically instructed for zero-shot NER on Italian language. |
|
|
|
Instructed on a reduced number of tags (PER, ORG, LOC), it is designed to tackle never-seen-before Named Entity tags by leveraging a prompt enriched with a DEFINITION and GUIDELINES for the NE to be extracted. |
|
|
|
<!DOCTYPE html> |
|
<html> |
|
<head> |
|
<title>Instruction Tuning Prompt</title> |
|
<style> |
|
.container { |
|
border: none; |
|
padding: 5px; |
|
width: 300px; |
|
margin: 0 auto; |
|
font-family: Arial, sans-serif; |
|
font-size: 8px; |
|
border-radius: 10px; /* Rounded borders for container */ |
|
overflow: hidden; /* Ensure child elements respect container's rounded borders */ |
|
} |
|
.header { |
|
background-color: black; |
|
color: white; |
|
padding: 5px; |
|
text-align: center; |
|
font-weight: bold; |
|
font-size: 14px; |
|
border-top-left-radius: 10px; /* Rounded top-left corner */ |
|
border-top-right-radius: 10px; /* Rounded top-right corner */ |
|
} |
|
.content { |
|
padding: 5px; |
|
} |
|
.definition, .guidelines { |
|
padding: 5px; |
|
border-radius: 10px; /* Rounded borders for definition and guidelines */ |
|
} |
|
.definition { |
|
background-color: #ccffcc; |
|
} |
|
.guidelines { |
|
background-color: #ffffcc; |
|
} |
|
.footer { |
|
background-color: black; |
|
color: white; |
|
padding: 10px; |
|
font-weight: bold; |
|
border-bottom-left-radius: 10px; |
|
border-bottom-right-radius: 10px; |
|
} |
|
</style> |
|
</head> |
|
<body> |
|
<div class="container"> |
|
<div class="header">Instruction Tuning Prompt</div> |
|
<div class="content"> |
|
<p>Ti viene fornito un input di testo (delimitato da tre virgolette) e un'istruzione.<br> |
|
Leggi il testo e rispondi all'istruzione alla fine.</p> |
|
<p>"""<br> |
|
{input di testo}<br> |
|
"""</p> |
|
<p><b>Istruzione:</b> Estrai tutte le entità di tipo <b>ENTITÀ MITOLOGICA</b> dal testo che hai letto.</p> |
|
<p>Ti vengono fornite una <b>DEFINIZIONE</b> e alcune <b>LINEE GUIDA</b>.</p> |
|
<div class="definition"> |
|
<p><b>DEFINIZIONE:</b> <b>ENTITÀ MITOLOGICA</b> denota personaggi, divinità, creature o figure mitologiche provenienti da tradizioni religiose, miti, leggende o folklore.</p> |
|
</div> |
|
<div class="guidelines"> |
|
<p><b>LINEE GUIDA:</b> Assicurati di non etichettare come ENTITÀ MITOLOGICA personaggi storici o letterari reali. Ad esempio, 'Alessandro Magno' è un personaggio storico, non una figura mitologica. Inoltre, fai attenzione a distinguere nomi comuni o nomi di luoghi che possono riferirsi anche a figure mitologiche, come 'Diana', che può essere un nome proprio e il nome della dea romana della caccia.</p> |
|
</div> |
|
<p>Restituisci una lista JSON di istanze di questo tipo. Restituisci una lista vuota se non sono presenti istanze.</p> |
|
</div> |
|
<div class="footer"></div> |
|
</div> |
|
</body> |
|
</html> |
|
|
|
|
|
```python |
|
from vllm import LLM, SamplingParams |
|
|
|
vllm_model = LLM(model="expertai/SLIMER-IT") |
|
|
|
sampling_params = SamplingParams(temperature=0, max_tokens=128) |
|
|
|
prompts = [prompter.generate_prompt(instruction, input) for instruction, input in instruction_input_pairs] |
|
responses = vllm_model.generate(prompts, sampling_params) |
|
``` |