Source code for rl4lms.envs.text_generation.post_processors
from nltk.tokenize import sent_tokenize
[docs]def three_sentence_summary(text):
"""
Returns first three sentences from the generated text
"""
return "\n".join(sent_tokenize(text)[:3])