File size: 1,879 Bytes
dfa6e7d
 
47f9126
 
 
 
 
 
 
dfa6e7d
 
 
 
 
 
 
 
57fd226
dfa6e7d
57fd226
0fed4ae
dfa6e7d
 
 
0fed4ae
 
dfa6e7d
0fed4ae
 
dfa6e7d
0fed4ae
 
 
dfa6e7d
0fed4ae
 
dfa6e7d
0fed4ae
 
dfa6e7d
0fed4ae
 
 
 
 
 
 
 
 
dfa6e7d
0fed4ae
 
 
 
dfa6e7d
0fed4ae
dfa6e7d
0fed4ae
dfa6e7d
47f9126
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
---
library_name: transformers
tags:
- text-generation
- NLP
- GPT-2
- movie-review
- cinema
license: apache-2.0
---

# Model Card for Model ID

## Model Details

### Model Description

This model is a specialized version of the GPT-2 architecture, fine-tuned for generating negative movie reviews. It aims to produce text reflecting strong dissatisfaction, capturing nuances in negative sentiment and expressing them effectively in generated content.

- **Model type:** GPT-2 fine-tuned for negative movie reviews
- **Language(s) (NLP):** English

## Uses

```python
from transformers import GPT2LMHeadModel, GPT2Tokenizer

# Specify the model path
model_path = "AigrisGPT"

# Load the model and tokenizer
model = GPT2LMHeadModel.from_pretrained(model_path)
tokenizer = GPT2Tokenizer.from_pretrained(model_path)

input_sequence = "This movie"
max_length = 100

# Encode the input text
input_ids = tokenizer.encode(input_sequence, return_tensors='pt')

# Generate text using the model
output_ids = model.generate(
    input_ids,
    max_length=max_length,
    pad_token_id=model.config.eos_token_id,
    top_k=50,
    top_p=0.95,
    do_sample=True
)

# Decode and print the generated text
generated_text = tokenizer.decode(output_ids[0], skip_special_tokens=True)
print(generated_text)
```

### Example of Model Output

Here is an example of text generated by this model with an input *This movie*:

*’This movie tries too hard to be a thriller film and to say there are lots of people like me who like this kind of movies it falls apart at some points. But the thing is this: these people would probably be bored with the genre anyway. All the characters are a mix of stereotypical, racist, violent and sexist stereotypes which are supposed to fit into a mmon genre. One that I found myself thinking about after I watched it. I should have read the books first. If not, I’*