示例#1
0
 def get_summary(self, text):
     '''
     Calls the body of the summarizer which is located in the nlp_queries.py file
     :param text: set of text that you want to summarize.
     :return: a summary of text inputted in the text field.
     '''
     clearLog()
     return get_summary(self=self, text=text)
示例#2
0
 def get_summary(self, text, num_beams=4, no_repeat_ngram_size=2, num_return_sequences=1,
                 early_stopping=True):
     '''
     Calls the body of the summarizer which is located in the nlp_queries.py file
     :param text: set of text that you want to summarize (str).
     :param max_summary_length: Max generated summary length (int).
     :param early_stopping: Sets early stopping (bool).
     :param num_return_sequences: Sets the number of likely possibilities to output (int).
     :param no_repeat_ngram_size: Sets the number of unrepeated consecutive n-grams (int).
     :param num_beams: Sets number of possibilities to explore in beam search (int).
     :return: a summary of text inputted in the text field.
     '''
     clearLog()
     return get_summary(self=self, text=text, num_beams=num_beams, no_repeat_ngram_size=no_repeat_ngram_size
                        , num_return_sequences=num_return_sequences, early_stopping=early_stopping)