Instructions to use VerbACxSS/sempl-it-v3-sentence-splitter-awq with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use VerbACxSS/sempl-it-v3-sentence-splitter-awq with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="VerbACxSS/sempl-it-v3-sentence-splitter-awq") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("VerbACxSS/sempl-it-v3-sentence-splitter-awq", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use VerbACxSS/sempl-it-v3-sentence-splitter-awq with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "VerbACxSS/sempl-it-v3-sentence-splitter-awq" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "VerbACxSS/sempl-it-v3-sentence-splitter-awq", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/VerbACxSS/sempl-it-v3-sentence-splitter-awq
- SGLang
How to use VerbACxSS/sempl-it-v3-sentence-splitter-awq with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "VerbACxSS/sempl-it-v3-sentence-splitter-awq" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "VerbACxSS/sempl-it-v3-sentence-splitter-awq", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "VerbACxSS/sempl-it-v3-sentence-splitter-awq" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "VerbACxSS/sempl-it-v3-sentence-splitter-awq", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use VerbACxSS/sempl-it-v3-sentence-splitter-awq with Docker Model Runner:
docker model run hf.co/VerbACxSS/sempl-it-v3-sentence-splitter-awq
| license: mit | |
| language: | |
| - it | |
| base_model: | |
| - abhishekchohan/Qwen3-4B-AWQ | |
| pipeline_tag: text-generation | |
| library_name: transformers | |
| tags: | |
| - legal | |
| # sempl-it-v3-sentence-splitter-awq | |
| SEMPL-IT aims to simplify Italian administrative texts using a progressive approach based on multiple specialized models. | |
| Each model addresses a specific aspect of the text transformation process, ensuring a step-by-step refinement. | |
| ## Simplification Pipeline | |
| The complete text simplification pipeline follows eight sequential steps: | |
| 1. [proofreading](https://huggingface.co/VerbACxSS/sempl-it-v3-proofreading-awq) | |
| 2. [lex](https://huggingface.co/VerbACxSS/sempl-it-v3-lex-awq) | |
| 3. [connectives](https://huggingface.co/VerbACxSS/sempl-it-v3-connectives-awq) | |
| 4. [expressions](https://huggingface.co/VerbACxSS/sempl-it-v3-expressions-awq) | |
| 5. [sentence-splitter](https://huggingface.co/VerbACxSS/sempl-it-v3-sentence-splitter-awq) (this) | |
| 6. [nominalizations](https://huggingface.co/VerbACxSS/sempl-it-v3-nominalizations-awq) | |
| 7. [verbs](https://huggingface.co/VerbACxSS/sempl-it-v3-verbs-awq) | |
| 8. [sentence-reorganizer](https://huggingface.co/VerbACxSS/sempl-it-v3-sentence-reorganizer-awq) | |
| 9. [explain](https://huggingface.co/VerbACxSS/sempl-it-v3-explain-awq) | |
| ## Web App | |
| To integrate this model into the full system, check out: | |
| - Frontend: [GitHub Repository](https://github.com/VerbACxSS/sempl-it-frontend) | |
| - Backend: [GitHub Repository](https://github.com/VerbACxSS/sempl-it-backend) | |
| - Inference: [GitHub Repository](https://github.com/VerbACxSS/sempl-it-inference) | |
| ## Usage | |
| Install the following dependencies: | |
| ```sh | |
| pip install transformers==4.49.0 | |
| pip install autoawq==0.2.9 | |
| pip install peft==0.15.0 | |
| ``` | |
| Define the system prompt and the text to simplify: | |
| ```py | |
| PROMPT = """Sei un esperto redattore di documenti istituzionali italiani. | |
| Dividi le frasi molto lunghe in frasi più brevi. **Non alterare il contenuto e lo stile del testo originale**. | |
| # Steps | |
| 1. Leggi attentamente il testo istituzionale. | |
| 2. Individua le frasi lunghe. | |
| 3. Dividi, quando possibile, le frasi individuate in frasi più brevi. | |
| # Output Format | |
| Il testo modificato con l'originale formattazione e suddivisione in sezioni e paragrafi. | |
| # Notes | |
| - Il testo fornito può essere complesso e richiede attenzione ai dettagli. | |
| - Esegui solamente le operazioni descritte, **non eliminare e non modificare altri contenuti**. | |
| - Assicurati che le implicazioni giuridiche e legali del documento siano mantenute. | |
| - Non modificare il testo tra virgolette.""" | |
| TEXT_TO_SIMPLIFY = """Il documento individua le esigenze di sviluppo necessarie per assicurare che i principi delineati dalla Legge Regionale 23 dicembre 2004, n. 29 e dai successivi atti normativi, sulla essenziale funzione della ricerca e innovazione nelle Aziende Sanitarie della Regione Emilia-Romagna, si traducano in azioni concrete nel Servizio Sanitario Regionale. | |
| Alla luce delle evidenze della letteratura internazionale, delle indicazioni della normativa nazionale e della valutazione di quanto già attuato a livello regionale negli anni passati, vengono individuati gli obiettivi di sviluppo e le linee per il raggiungimento dei suddetti obiettivi.""" | |
| ``` | |
| Load SEMPL-IT model and tokenizer: | |
| ```py | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| tokenizer = AutoTokenizer.from_pretrained("VerbACxSS/sempl-it-v3-sentence-splitter-awq") | |
| model = AutoModelForCausalLM.from_pretrained("VerbACxSS/sempl-it-v3-sentence-splitter-awq").to("cuda") | |
| ``` | |
| Define and apply chat template: | |
| ```py | |
| chat = [ | |
| {"role": "system", "content": PROMPT}, | |
| {"role": "assistant", "content": TEXT_TO_SIMPLIFY}, | |
| ] | |
| formatted_chat = tokenizer.apply_chat_template( | |
| chat, | |
| tokenize=False, | |
| add_generation_prompt=True | |
| ) | |
| model_inputs = tokenizer([formatted_chat], return_tensors="pt").to("cuda") | |
| ``` | |
| Use SEMPL_IT model with following sampling parameters to generate `simplified_text`: | |
| ```py | |
| generated_ids = model.generate( | |
| **model_inputs, | |
| max_new_tokens=4096, | |
| temperature=0.1, | |
| top_p=0.2 | |
| ) | |
| simplified_text = tokenizer.decode(generated_ids[0][len(model_inputs.input_ids[0]):], skip_special_tokens=True) | |
| print(simplified_text) | |
| ``` | |
| ## Acknowledgements | |
| This contribution is a result of the research conducted within the framework of the PRIN 2020 (Progetti di Rilevante Interesse Nazionale) "VerbACxSS: on analytic verbs, complexity, synthetic verbs, and simplification. For accessibility" (Prot. 2020BJKB9M), funded by the Italian Ministero dell'Università e della Ricerca. |