pointer_summarizer icon indicating copy to clipboard operation
pointer_summarizer copied to clipboard

how to predict single line after training

Open Lanme opened this issue 4 years ago • 3 comments

I have trained model for chinese weibo data ,how could i predict single line?

Lanme avatar Sep 27 '19 04:09 Lanme

Just modify the function decode() in decode.py and remove the batcher in __init__ Example:

def decode(self, article):
         example = Example(article, [], self._vocab)
         b = [example for _ in range(self.batch_size)]
         batch = Batch(b, self._vocab, self.batch_size)
         # Run beam search to get best Hypothesis
         best_summary = self.beam_search(batch)
         ......

crystal0913 avatar Oct 31 '19 12:10 crystal0913

Just modify the function decode() in decode.py and remove the batcher in __init__ Example:

def decode(self, article):
         example = Example(article, [], self._vocab)
         b = [example for _ in range(self.batch_size)]
         batch = Batch(b, self._vocab, self.batch_size)
         # Run beam search to get best Hypothesis
         best_summary = self.beam_search(batch)
         ......

hello,Can you share the changed code?

niuweicai avatar Jan 07 '20 03:01 niuweicai

Hi, have you being sucessful in predict the single line, i am recently working on my graduation project which requiring a display system of automatic summarization.

gaozhiguang avatar Apr 25 '21 05:04 gaozhiguang