This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import spacy | |
def get_clozed_sentence(sentence): | |
# use basic nlp to identify keyword in sentence to cloze | |
keywords = get_keywords(sentence) | |
result = sentence # start with un-clozed sentence as result | |
for idx, keyword in enumerate(keywords): | |
result = cloze_out_keyword(keyword, idx, result) | |
return result |