This commit is contained in:
2025-08-05 15:15:36 +02:00
parent 4bd960ed05
commit 7fabb4163a
192 changed files with 14901 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
from transformers import pipeline
# Load the pipeline for text classification
classifier = pipeline("zero-shot-classification", model="typeform/distilbert-base-uncased-mnli")
# Define the possible intents
candidate_labels = ["complaint", "feedback", "appointment","travel","agenda","taskmanagement","religion","fire test"]
def determine_intent(user_input):
result = classifier(user_input, candidate_labels)
print(result)
return result["labels"][0] # The intent with the highest score
# Example user input
user_input = '''
Playing with matches is dangerous.
Can you book me a meeting, its about flying to paris
'''
# Determine the intent
for i in range(10):
intent = determine_intent(user_input)
print(f"User intent: {intent}")