Instructions to use elplaguister/patent_classifier_qwen with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use elplaguister/patent_classifier_qwen with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("elplaguister/patent_classifier_qwen") 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
ํ๊ตญ ํนํ-KOS ์๋ถ๋ฅ ๊ฒ์ ์๋ฒ ๋ฉ ๋ชจ๋ธ
Embedding-Factory์์ ํ๊ตญ ํนํ์ KOS ์๋ถ๋ฅ ์ค๋ช ์ ์๋ฏธ์ ๊ฒ์์ ์ํด fine-tuningํ ๋ชจ๋ธ์ ๋๋ค.
๋ชจ๋ธ ์ ๋ณด
| ํญ๋ชฉ | ๋ด์ฉ |
|---|---|
| Base model | Qwen/Qwen3-Embedding-0.6B |
| ํ์ต ๋ฐ์ดํฐ | ํนํ 2,002๊ฑด |
| ํ์ต epoch | 3 |
| cutoff length | 32,768 |
| ์ต์ข ํ์ต loss | 0.2761 |
| Loss | Cached Multiple Negatives Ranking Loss |
| ๊ฒ์ ๋์ | KOS ์๋ถ๋ฅ 2,522๊ฐ |
| positive ์ ์ | ํนํ์ ๋งคํ๋ ์๋ถ๋ฅ์ฝ๋ ์ ์ฒด |
์ ๋ ฅ ํ์
ํนํ anchor๋ ์ด๋ก + ๊ธฐ์ ๊ตฌ์ฑ + ๋ฐฐ๊ฒฝ๊ธฐ์ ์ ์ด์ด ๋ถ์ธ ํ
์คํธ์
๋๋ค.
query:
Instruct: Given a patent abstract, retrieve the relevant technology classification description.\nQuery: {patent_anchor}
taxonomy document:
{taxonomy_text} # raw document; prefix ์์
Nemotron์ query์ query: , document์ passage: ๋ฅผ ์ฌ์ฉํฉ๋๋ค. Qwen3๋ query instruction์ ์ ํํ ํ ๋ฒ๋ง ์ฌ์ฉํ๋ฉฐ taxonomy document์๋ prefix๋ฅผ ๋ถ์ด์ง ์์ต๋๋ค.
์ฌ์ฉ ์์
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("elplaguister/patent_classifier_en_qwen3_embedding_0_6b", trust_remote_code=True)
model.max_seq_length = 32768
patent_anchor = "์ด๋ก ๋ด์ฉ ๊ธฐ์ ๊ตฌ์ฑ ๋ด์ฉ ๋ฐฐ๊ฒฝ๊ธฐ์ ๋ด์ฉ"
taxonomy_text = "๋๋ถ๋ฅ๋ช
:...-์ค๋ถ๋ฅ๋ช
:...-์๋ถ๋ฅ๋ช
:...:์๋ถ๋ฅ ์ค๋ช
..."
query = [f"Instruct: Given a patent abstract, retrieve the relevant technology classification description.\nQuery: {{patent_anchor}}"]
document = [taxonomy_text]
q_vec = model.encode(query, normalize_embeddings=True)
d_vec = model.encode(document, normalize_embeddings=True)
similarity = q_vec @ d_vec.T
ํ๊ฐ ์ ๋ณด
์ ์ฒด taxonomy๋ฅผ ๊ฒ์ ํ๋ก ์ฌ์ฉํ๊ณ , ๊ฐ ํนํ์ ๋งคํ ์๋ถ๋ฅ ์ ์ฒด๋ฅผ ์ ๋ต(positive)์ผ๋ก ํ๊ฐํ์ต๋๋ค. ํ๊ฐ ์งํ๋ nDCG@10, MRR@10, Hit@1, Recall@10์ ๋๋ค.
์ ๋ก๋ ํ์ผ ๊ตฌ์ฑ
์ด ํด๋๋ inference์ ํ์ํ ํ์ผ๋ง ํฌํจํฉ๋๋ค. optimizer.pt, scheduler.pt, rng_state.pth, trainer_state.json, training_args.bin์ ์ ์ธํ์ต๋๋ค.
- Downloads last month
- 16