Downloads · 30 days
10
3% of all-time downloads
Kendamarron/fineweb-edu-classifier-ja
fineweb-edu-classifier-ja is a text classification model from Kendamarron. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
HuggingFaceFW/fineweb-edu-classifierを再現するために、日本語データでpkshatech/GLuCoSE-base-jaを学習したモデルです。
Downloads · 30 days
10
3% of all-time downloads
All-time downloads
311
Public
Parameters
133M
1.4 GB on disk
Likes
3
Public
Click a slice to open those files.
.pt890 MB · 63%
From the Hugging Face model README
HuggingFaceFW/fineweb-edu-classifierを再現するために、日本語データでpkshatech/GLuCoSE-base-jaを学習したモデルです。
学習データは、oscar-corpus/OSCAR-2301の日本語サブセットから抽出した16913個の文書に対して、TheBloke/Mixtral-8x7B-Instruct-v0.1-GGUFのQ3_Kを使ってスコアリングしたものを使用しています。
詳細: https://zenn.dev/kendama/articles/aba63f14f88e6e
コード: https://github.com/kkendama/fineweb-edu-classifier-ja
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("Kendamarron/fineweb-edu-classifier-ja")
model = AutoModelForSequenceClassification.from_pretrained("Kendamarron/fineweb-edu-classifier-ja")
def predict(text):
inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs)
logits = outputs.logits
predicted_class = torch.argmax(logits, dim=-1).item()
return predicted_class
text = "富士山は、日本で最も有名な山であり、日本全土にわたる広大な自然公園の一つです。高さは3,776メートルで、日本で最も高い山です。富士山は、東京都、静岡県、山梨県の3つの県にまたがっています。"
print(predict(text))
# >> 2