Update src/paraphrase/Paraphrase.py
Browse files
src/paraphrase/Paraphrase.py
CHANGED
@@ -22,7 +22,7 @@ def paraphraseParaphraseMethod(requestValue : str):
|
|
22 |
for SENTENCE in tokenized_sent_list:
|
23 |
text = "paraphrase: " + SENTENCE
|
24 |
|
25 |
-
encoding = tokenizer(text, return_tensors="pt", padding=
|
26 |
input_ids, attention_masks = encoding["input_ids"], encoding["attention_mask"]
|
27 |
|
28 |
beam_outputs = model.generate(
|
@@ -31,6 +31,7 @@ def paraphraseParaphraseMethod(requestValue : str):
|
|
31 |
max_length=512,
|
32 |
num_beams=5,
|
33 |
length_penalty=0.8,
|
|
|
34 |
early_stopping=True
|
35 |
)
|
36 |
|
|
|
22 |
for SENTENCE in tokenized_sent_list:
|
23 |
text = "paraphrase: " + SENTENCE
|
24 |
|
25 |
+
encoding = tokenizer(text, return_tensors="pt", padding=longest, truncation=True)
|
26 |
input_ids, attention_masks = encoding["input_ids"], encoding["attention_mask"]
|
27 |
|
28 |
beam_outputs = model.generate(
|
|
|
31 |
max_length=512,
|
32 |
num_beams=5,
|
33 |
length_penalty=0.8,
|
34 |
+
temperature=1.5,
|
35 |
early_stopping=True
|
36 |
)
|
37 |
|