Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc1e3117

Browse files
committed
update paraphrasing code to fix an error
1 parente840928 commitc1e3117

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

‎machine-learning/nlp/text-paraphrasing/Paraphrasing_with_Transformers_PythonCode.ipynb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -644,8 +644,9 @@
644644
" print(\"Input_phrase:\", phrase)\n",
645645
" print(\"-\"*100)\n",
646646
" paraphrases = parrot.augment(input_phrase=phrase)\n",
647-
" for paraphrase in paraphrases:\n",
648-
" print(paraphrase)"
647+
" if paraphrases:\n",
648+
" for paraphrase in paraphrases:\n",
649+
" print(paraphrase)"
649650
]
650651
}
651652
],

‎machine-learning/nlp/text-paraphrasing/paraphrasing_with_transformers_pythoncode.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ def get_paraphrased_sentences(model, tokenizer, sentence, num_return_sequences=5
6161
print("Input_phrase: ",phrase)
6262
print("-"*100)
6363
paraphrases=parrot.augment(input_phrase=phrase)
64-
forparaphraseinparaphrases:
65-
print(paraphrase)
64+
ifparaphrases:
65+
forparaphraseinparaphrases:
66+
print(paraphrase)
6667

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp