Sentence Similarity
sentence-transformers
Safetensors
Ukrainian
xlm-roberta
feature-extraction
information-retrieval
dense
Eval Results (legacy)
text-embeddings-inference
Run this model with HF Jobs
Run ipsnan/keywordsextraction on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/ipsnan/keywordsextraction. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/ipsnan/keywordsextraction on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use ipsnan/keywordsextraction with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use ipsnan/keywordsextraction with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("ipsnan/keywordsextraction") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files11 unmodified lines1213141516171811 unmodified linesinstance_prompt: nulllicense: llama3.1---# LoRA Adapter for Keyword Extraction (Ukrainian)<Gallery />11 unmodified lines1213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119211 unmodified linesinstance_prompt: nulllicense: llama3.1---# 🇺🇦 LoRA Adapter for Keyword Extraction (Ukrainian)## 📌 OverviewThis repository contains a **LoRA adapter** fine-tuned for **extracting keywords from Ukrainian scientific and business documents**.The model is trained on instruction-style data and generates a concise list of the most important keywords or key phrases from a given document.---## 🧠 Base Model* **Base model:** `meta-llama/Llama-3.1-8B-Instruct`* **Architecture:** Causal Language Model (LLM)* **Fine-tuning method:** LoRA (Low-Rank Adaptation)* **Library:** Transformers + PEFT> ⚠️ The base model is not included due to licensing restrictions by Meta.> You must request access to the original model separately.---## ⚙️ Training Setup### 🔧 Technique* **QLoRA (4-bit quantization)*** Efficient training on limited GPU memory using:* `bitsandbytes` (NF4 quantization)* gradient checkpointing* paged AdamW optimizer (8-bit)### 🧩 LoRA Configuration* Rank (`r`): 16* Alpha: 32* Dropout: 0.05* Target modules:* `q_proj`, `k_proj`, `v_proj`, `o_proj`* `gate_proj`, `up_proj`, `down_proj`---## 📊 DatasetThe model is trained on a custom dataset in **JSONL format**, where each record contains:* `input` — Ukrainian document text* `output` — list of keywords### Example:```json{"input": "Цифрові технології в освіті...","output": "цифрові технології\nосвіта\nedtech\n..."}```---## 💬 Prompt FormatThe model uses the native chat format of LLaMA:**System message:**```Ти — експерт з вилучення ключових слів з наукових та ділових документів українською мовою.```**User input:**```Документ:<text>Виділи 10 найважливіших ключових слів або словосполучень (1-3 слова).Відповідь — лише список, по одному на рядку, без пояснень.```---## 🚀 Usage### 1. Load base model + adapter```pythonfrom transformers import AutoModelForCausalLM, AutoTokenizerfrom peft import PeftModelbase_model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.1-8B-Instruct",device_map="auto")model = PeftModel.from_pretrained(base_model,"ipsnan/keywordsextraction")tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-3.1-8B-Instruct")```---### 2. Run inference```pythonprompt = "Документ:\nШтучний інтелект активно використовується...\n\nВиділи ключові слова."inputs = tokenizer(prompt, return_tensors="pt").to("cuda")outputs = model.generate(**inputs, max_new_tokens=100)print(tokenizer.decode(outputs[0], skip_special_tokens=True))```---## 📈 Training Details* Epochs: 3* Learning rate: 2e-4* Batch size: 1 (with gradient accumulation = 16)* Max sequence length: 1024* Train/test split: 95% / 5%---## 📦 OutputThis repository contains:* `adapter_model.safetensors` — LoRA weights* `adapter_config.json` — configuration* tokenizer files---## 🎯 Task**Keyword extraction (Ukrainian NLP)**The model is optimized for:* scientific texts* academic content* business documents---## ⚠️ Limitations* Works best with Ukrainian language texts* Output format is strictly enforced (list of keywords)* Performance depends on input length and clarity---## 📜 License* LoRA adapter: open for use* Base model: subject to Meta LLaMA license---## 🙌 Acknowledgments* Meta for LLaMA models* Hugging Face ecosystem* PEFT & Transformers libraries---<Gallery />
README.md+175-1