Views
No views yet
1# Import necessary libraries
2from transformers import pipeline
3
4# Define the model name to be used in the pipeline
5model_name = 'wayveai/Lingo-Judge'
6
7# Define the question and its corresponding answer and prediction
8question = "Are there any pedestrians crossing the road? If yes, how many?"
9answer = "1"
10prediction = "Yes, there is one"
11
12# Initialize the pipeline with the specified model, device, and other parameters
13pipe = pipeline("text-classification", model=model_name)
14# Format the input string with the question, answer, and prediction
15input = f"[CLS]\nQuestion: {question}\nAnswer: {answer}\nStudent: {prediction}"
16
17# Pass the input through the pipeline to get the result
18result = pipe(input)
19
20# Print the result and score
21score = result[0]['score']
22print(score > 0.5, score)1@article{marcu2023lingoqa,
2 title={LingoQA: Video Question Answering for Autonomous Driving},
3 author={Ana-Maria Marcu and Long Chen and Jan Hünermann and Alice Karnsund and Benoit Hanotte and Prajwal Chidananda and Saurabh Nair and Vijay Badrinarayanan and Alex Kendall and Jamie Shotton and Oleg Sinavski},
4 journal={arXiv preprint arXiv:2312.14115},
5 year={2023},
6}