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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Quantization made by Richard Erkhov.
|
| 2 |
+
|
| 3 |
+
[Github](https://github.com/RichardErkhov)
|
| 4 |
+
|
| 5 |
+
[Discord](https://discord.gg/pvy7H8DZMG)
|
| 6 |
+
|
| 7 |
+
[Request more models](https://github.com/RichardErkhov/quant_request)
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
LLaMAntino-3-SLIMER-IT - bnb 4bits
|
| 11 |
+
- Model creator: https://huggingface.co/expertai/
|
| 12 |
+
- Original model: https://huggingface.co/expertai/LLaMAntino-3-SLIMER-IT/
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
Original model description:
|
| 18 |
+
---
|
| 19 |
+
language:
|
| 20 |
+
- it
|
| 21 |
+
pipeline_tag: text-generation
|
| 22 |
+
license: llama3
|
| 23 |
+
tags:
|
| 24 |
+
- facebook
|
| 25 |
+
- meta
|
| 26 |
+
- pythorch
|
| 27 |
+
- llama
|
| 28 |
+
- llama-3
|
| 29 |
+
- llamantino
|
| 30 |
+
- zero-shot NER
|
| 31 |
+
- NER
|
| 32 |
+
base_model: swap-uniba/LLaMAntino-3-ANITA-8B-Inst-DPO-ITA
|
| 33 |
+
---
|
| 34 |
+
|
| 35 |
+
# SLIMER-IT: Show Less Instruct More Entity Recognition - Italian language
|
| 36 |
+
|
| 37 |
+
SLIMER-IT is an LLM specifically instructed for zero-shot NER on Italian language.
|
| 38 |
+
|
| 39 |
+
Github repository: https://github.com/andrewzamai/SLIMER_IT
|
| 40 |
+
|
| 41 |
+
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.
|
| 42 |
+
|
| 43 |
+
Built with Meta Llama 3, based on the Italian instruction-tuned version swap-uniba/LLaMAntino-3-ANITA-8B-Inst-DPO-ITA
|
| 44 |
+
|
| 45 |
+
<!DOCTYPE html>
|
| 46 |
+
<html>
|
| 47 |
+
<head>
|
| 48 |
+
<title>Instruction Tuning Prompt</title>
|
| 49 |
+
<style>
|
| 50 |
+
.container {
|
| 51 |
+
border: none;
|
| 52 |
+
padding: 5px;
|
| 53 |
+
width: 300px;
|
| 54 |
+
margin: 0 auto;
|
| 55 |
+
font-family: Arial, sans-serif;
|
| 56 |
+
font-size: 8px;
|
| 57 |
+
border-radius: 10px; /* Rounded borders for container */
|
| 58 |
+
overflow: hidden; /* Ensure child elements respect container's rounded borders */
|
| 59 |
+
}
|
| 60 |
+
.header {
|
| 61 |
+
background-color: black;
|
| 62 |
+
color: white;
|
| 63 |
+
padding: 5px;
|
| 64 |
+
text-align: center;
|
| 65 |
+
font-weight: bold;
|
| 66 |
+
font-size: 14px;
|
| 67 |
+
border-top-left-radius: 10px; /* Rounded top-left corner */
|
| 68 |
+
border-top-right-radius: 10px; /* Rounded top-right corner */
|
| 69 |
+
}
|
| 70 |
+
.content {
|
| 71 |
+
padding: 5px;
|
| 72 |
+
}
|
| 73 |
+
.definition, .guidelines {
|
| 74 |
+
padding: 5px;
|
| 75 |
+
border-radius: 10px; /* Rounded borders for definition and guidelines */
|
| 76 |
+
}
|
| 77 |
+
.definition {
|
| 78 |
+
background-color: #ffa3f0;
|
| 79 |
+
}
|
| 80 |
+
.guidelines {
|
| 81 |
+
background-color: #93e2fa;
|
| 82 |
+
}
|
| 83 |
+
.footer {
|
| 84 |
+
background-color: black;
|
| 85 |
+
color: white;
|
| 86 |
+
padding: 10px;
|
| 87 |
+
font-weight: bold;
|
| 88 |
+
border-bottom-left-radius: 10px;
|
| 89 |
+
border-bottom-right-radius: 10px;
|
| 90 |
+
}
|
| 91 |
+
</style>
|
| 92 |
+
</head>
|
| 93 |
+
<body>
|
| 94 |
+
<div class="container">
|
| 95 |
+
<div class="header">Instruction Tuning Prompt</div>
|
| 96 |
+
<div class="content">
|
| 97 |
+
<p>Ti viene fornito un input di testo (delimitato da tre virgolette) e un'istruzione.<br>
|
| 98 |
+
Leggi il testo e rispondi all'istruzione alla fine.</p>
|
| 99 |
+
<p>"""<br>
|
| 100 |
+
{input di testo}<br>
|
| 101 |
+
"""</p>
|
| 102 |
+
<p><b>Istruzione:</b> Estrai tutte le entità di tipo <b>ENTITÀ MITOLOGICA</b> dal testo che hai letto.</p>
|
| 103 |
+
<p>Ti vengono fornite una <b>DEFINIZIONE</b> e alcune <b>LINEE GUIDA</b>.</p>
|
| 104 |
+
<div class="definition">
|
| 105 |
+
<p><b>DEFINIZIONE:</b> <b>ENTITÀ MITOLOGICA</b> denota personaggi, divinità, creature o figure mitologiche provenienti da tradizioni religiose, miti, leggende o folklore.</p>
|
| 106 |
+
</div>
|
| 107 |
+
<div class="guidelines">
|
| 108 |
+
<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>
|
| 109 |
+
</div>
|
| 110 |
+
<p>Restituisci una lista JSON di istanze di questo tipo. Restituisci una lista vuota se non sono presenti istanze.</p>
|
| 111 |
+
</div>
|
| 112 |
+
<div class="footer"></div>
|
| 113 |
+
</div>
|
| 114 |
+
</body>
|
| 115 |
+
</html>
|
| 116 |
+
|
| 117 |
+
|
| 118 |
+
<!DOCTYPE html>
|
| 119 |
+
<html lang="en">
|
| 120 |
+
<head>
|
| 121 |
+
<meta charset="UTF-8">
|
| 122 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 123 |
+
<title>JSON Template</title>
|
| 124 |
+
<style>
|
| 125 |
+
body {
|
| 126 |
+
font-family: Arial, sans-serif;
|
| 127 |
+
line-height: 1.6;
|
| 128 |
+
padding: 20px;
|
| 129 |
+
}
|
| 130 |
+
.description {
|
| 131 |
+
font-weight: bold;
|
| 132 |
+
color: #333;
|
| 133 |
+
margin-bottom: 10px;
|
| 134 |
+
}
|
| 135 |
+
.template {
|
| 136 |
+
background-color: #f0f0f0;
|
| 137 |
+
padding: 10px;
|
| 138 |
+
border-radius: 5px;
|
| 139 |
+
margin-bottom: 20px;
|
| 140 |
+
}
|
| 141 |
+
.highlight-orange {
|
| 142 |
+
color: orange;
|
| 143 |
+
font-weight: bold;
|
| 144 |
+
}
|
| 145 |
+
</style>
|
| 146 |
+
</head>
|
| 147 |
+
<body>
|
| 148 |
+
<div class="description">JSON SLIMER-IT prompt</div>
|
| 149 |
+
<div class="template">
|
| 150 |
+
<pre>{
|
| 151 |
+
"description": "SLIMER prompt for Italian",
|
| 152 |
+
"prompt_input": "<|start_header_id|>system<|end_header_id|>\n\n Sei un utile assistente.<|eot_id|>\n<|start_header_id|>user<|end_header_id|>\n\nTi viene fornito un input di testo (delimitato da tre virgolette) e un'istruzione. \nLeggi il testo e rispondi all'istruzione alla fine.\n\"\"\"\n{<span class="highlight-orange">input</span>}\n\"\"\"\nIstruzione: Estrai tutte le entità di tipo {<span class="highlight-orange">NE_name</span>} dal testo che hai letto. Ti vengono fornite una DEFINIZIONE e alcune LINEE GUIDA.\nDEFINIZIONE: {<span class="highlight-orange">definition</span>}\nLINEE GUIDA: {<span class="highlight-orange">guidelines</span>}\nRestituisci una lista JSON di istanze di questo tipo. Restituisci una lista vuota se non sono presenti istanze.<|eot_id|>\n<|start_header_id|>assistant<|end_header_id|>\n\n"
|
| 153 |
+
}</pre>
|
| 154 |
+
</div>
|
| 155 |
+
</body>
|
| 156 |
+
</html>
|
| 157 |
+
|
| 158 |
+
|
| 159 |
+
```python
|
| 160 |
+
from vllm import LLM, SamplingParams
|
| 161 |
+
|
| 162 |
+
vllm_model = LLM(model="expertai/SLIMER-IT")
|
| 163 |
+
|
| 164 |
+
sampling_params = SamplingParams(temperature=0, max_tokens=128)
|
| 165 |
+
|
| 166 |
+
prompts = [prompter.generate_prompt(instruction, input) for instruction, input in instruction_input_pairs]
|
| 167 |
+
responses = vllm_model.generate(prompts, sampling_params)
|
| 168 |
+
```
|
| 169 |
+
|
| 170 |
+
## Citation
|
| 171 |
+
|
| 172 |
+
If you find SLIMER-IT useful in your research or work, please cite the following paper:
|
| 173 |
+
|
| 174 |
+
``` latex
|
| 175 |
+
@misc{zamai2024slimeritzeroshotneritalian,
|
| 176 |
+
title={SLIMER-IT: Zero-Shot NER on Italian Language},
|
| 177 |
+
author={Andrew Zamai and Leonardo Rigutini and Marco Maggini and Andrea Zugarini},
|
| 178 |
+
year={2024},
|
| 179 |
+
eprint={2409.15933},
|
| 180 |
+
archivePrefix={arXiv},
|
| 181 |
+
primaryClass={cs.CL},
|
| 182 |
+
url={https://arxiv.org/abs/2409.15933},
|
| 183 |
+
}
|
| 184 |
+
```
|
| 185 |
+
|