Views
No views yet
camembert-base model and is designed to classify user intent
questions for the website data.gov.ma in French. It can distinguish whether a user is making a general inquiry
or requesting specific data. The training data was generated using GPT-4o-mini and includes information specific
to data.gov.ma. The model was fine-tuned using LoRA with specific hyperparameters, achieving an accuracy of up to 0.98.1from transformers import AutoModelForSequenceClassification, AutoTokenizer, pipeline
2import torch
3from peft import AutoPeftModelForSequenceClassification
4
5
6model_name = "tferhan/Intent-GovMa-v1"
7
8tokenizer = AutoTokenizer.from_pretrained(model_name)
9model = AutoPeftModelForSequenceClassification.from_pretrained(model_name)
10nlp_pipeline = pipeline("text-classification", model=model, tokenizer=tokenizer, device=0 if torch.cuda.is_available() else -1)
11
12questions = ["qu'est ce que open data", "je veux les informations de l'eau potable"]
13results = nlp_pipeline_class(questions)
14
15for result in results:
16 print(result)
17
18#{'label': 'LABEL_0', 'score': 0.9999700784683228} === general
19#{'label': 'LABEL_1', 'score': 0.9994990825653076} === request_data10442e-5epoch0.01log_history.json