File size: 5,504 Bytes
d14083f 67b9ca1 d14083f 67b9ca1 d14083f 67b9ca1 67e4448 d14083f fdeb901 d14083f d9efa67 d8a5981 d14083f c90fbc2 8289a93 86047d4 c90fbc2 86047d4 c90fbc2 0bf97f8 c90fbc2 7659d67 2638c20 7659d67 0bf97f8 7659d67 d14083f 2638c20 392be81 0bf97f8 c90fbc2 d14083f 2638c20 ef55d76 0bf97f8 ef55d76 d14083f 67b9ca1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
---
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 |