tau/commonsense_qa
Viewer • Updated • 12.1k • 103k • 161
Run timpal0l/xlm-roberta-base-faq-extractor 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:
Use HF Jobs to fine-tune https://huggingface.co/timpal0l/xlm-roberta-base-faq-extractor. 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.
Use HF Jobs to run batch inference with https://huggingface.co/timpal0l/xlm-roberta-base-faq-extractor 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.
How to use timpal0l/xlm-roberta-base-faq-extractor with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="timpal0l/xlm-roberta-base-faq-extractor") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("timpal0l/xlm-roberta-base-faq-extractor")
model = AutoModelForSequenceClassification.from_pretrained("timpal0l/xlm-roberta-base-faq-extractor", device_map="auto")This model is trained to determine whether a question/statement is a FAQ, in the domain of products, businesses, website faqs, etc.
For e.g "What is the warranty of your product?" In contrast, daily questions such as "how are you?", "what is your name?", or simple statements such as "this is a tree".
from transformers import pipeline
classifier = pipeline("text-classification", "timpal0l/xlm-roberta-base-faq-extractor")
label_map = {"LABEL_0" : False, "LABEL_1" : True}
documents = ["What is the warranty for iPhone15?",
"How old are you?",
"Nice to meet you",
"What is your opening hours?",
"What is your name?",
"The weather is nice"]
predictions = classifier(documents)
for p, d in zip(predictions, documents):
print(d, "--->", label_map[p["label"]])
What is the warranty for iPhone15? ---> True
How old are you? ---> False
Nice to meet you ---> False
What is your opening hours? ---> True
What is your name? ---> False
The weather is nice ---> False