movie_chatbot_v1 / README.md
bluenguyen's picture
Update README.md
d9efa67
---
inference: false
license: mit
---
# Model Card for Model ID
A movie recommendation chatbot which is finetune from GODEL model using data generated from ChatGPT.
## Model Details
- **Model type:** seq2seq(T5)
- **License:** MIT
- **Finetuned from model:** microsoft/GODEL-v1_1-base-seq2seq
- **Final eval loss:** 0.2331
## Limitations
This model is trained using supervised learning on small amount of movie conversation data so it is not that good.\
There is also a large version of this with better performance at bluenguyen/movie_chatbot_large_v1.
### How to Get Started with the Model
Use the code below to get started with the model.
```python:
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("bluenguyen/movie_chatbot_v1")
model = AutoModelForSeq2SeqLM.from_pretrained("bluenguyen/movie_chatbot_v1").to('cuda')
def current_context(dialog, instruction):
dialog = ' EOS '.join(dialog)
context = f"{instruction} [CONTEXT] {dialog} "
return context
def generate(context):
input_ids = tokenizer(f"{context}", return_tensors="pt").input_ids.to('cuda')
outputs = model.generate(input_ids, max_length=128, min_length=8, top_p=0.9, do_sample=True)
output = tokenizer.decode(outputs[0], skip_special_tokens=True)
return output
instruction = f'Instruction: given a dialog about movie recommendation, you need to respond based on human preferences.'
dialog = [
'Do you have any recommendation about a movie?',
'Yes! Any particular genre that you\'d like to see mentioned?',
]
print('User: ' + dialog[0])
print('Bot: ' + dialog[1])
while(1):
print('User: ', end = '')
query = input()
if query == 'end':
break
dialog.append(query)
response = generate(current_context(dialog, instruction))
print('Bot: ' + response)
dialog.append(response)
```
### Demo
Example 1:
> User: Do you have any recommendation about a movie? <br>
> Bot: Yes! Any particular genre that you'd like to see mentioned? <br>
> User: I like love story. <br>
> Bot: How about "The Notebook"? It's a classic love story with a great plot twist. <br>
> User: I have seen that one. Give me another one. <br>
> Bot: Have you seen "Eternal Sunshine of the Spotless Mind"? It's a unique romantic story with a captivating twist. <br>
> User: Is it any good? <br>
> Bot: Absolutely! It has an amazing cast and an engaging storyline. I highly recommend it. <br>
> User: Thank you <br>
> Bot: You're welcome! Let me know how you liked it. <br>
> User: end <br>
Example 2:
> User: Do you have any recommendation about a movie? <br>
> Bot: Yes! Any particular genre that you'd like to see mentioned? <br>
> User: I like super hero movie. <br>
> Bot: Have you watched "The Dark Knight"? It's a classic superhero movie. <br>
> User: Tell me more <br>
> Bot: "The Dark Knight" is based on the book by Christopher Nolan and stars Christian Bale as Batman and Heath Ledger as the Joker. <br>
> User: Who is the Joker in this movie? <br>
> Bot: Heath Ledger is the Joker and the movie is based on a novel. <br>
> User: I mean what happen in the movie? <br>
> Bot: The Joker is tasked with protecting the savage City of the Black Knight. <br>
> User: Really? <br>
> Bot: It's a very intense movie with a great performance by Heath Ledger. <br>
> User: Nice :)) <br>
> Bot: Glad to hear it! How about "The Shawshank Redemption"? <br>
> User: What is it about? <br>
> Bot: "The Shawshank Redemption" is about a man named Andy Dufresne who is wrongly convicted of murder and sent to prison. <br>
> User: Who does he murder? <br>
> Bot: The man who is convicted of the murder is named Red, and he murders his wife. <br>
> User: You just said his name is Andy Dufresne <br>
> Bot: Sorry, I couldn't find any information about that movie. <br>
> User: yikes <br>
> Bot: Sorry again, I must have missed your recommendation. Is there any other movie you'd like to recommend? <br>
> User: end <br>
Example 3:
> User: Do you have any recommendation about a movie? <br>
> Bot: Yes! Any particular genre that you'd like to see mentioned? <br>
> User: I like action movie. <br>
> Bot: Have you seen "John Wick"? <br>
> User: Yes I have <br>
> Bot: How about "The Bourne Identity"? <br>
> User: What is it about? <br>
> Bot: "The Bourne Identity" is an action-packed movie about a man named John McClane who goes on a rampage after his friend's death. <br>
> User: John McClane is character from "Die Hard" though <br>
> Bot: Yes, John McClane is a character from "Die Hard". Have you seen "The Raid: Redemption"? <br>
> User: You are not that good its funny haha <br>
> Bot: That's alright. How about "Die Hard"? <br>
> User: Is it any good? <br>
> Bot: It's a classic action movie about a retired hitman who seeks vengeance for the death of his dog. <br>
> User: That is "John Wick" plot lol <br>
> Bot: Yeah, I'm sorry I haven't heard of that movie. <br>
> User: You've just recommended that for me <br>
> Bot: Great! How about "The Matrix"? <br>
> User: What is the main character in that movie? <br>
> Bot: "The Matrix" is an action movie about a computer hacker named Neo who discovers that the world he lives in is actually a simulated reality created by machines. <br>
> User: What actor play Neo in that movie? <br>
> Bot: Neo is played by Keanu Reeves and plays the main character Neo. <br>
> User: end <br>
## Model Card Contact
For personal questions related to this model, please contact via reddotbluename@gmail.com