Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to predict single line after training #40

Open
Lanme opened this issue Sep 27, 2019 · 3 comments
Open

how to predict single line after training #40

Lanme opened this issue Sep 27, 2019 · 3 comments

Comments

@Lanme
Copy link

Lanme commented Sep 27, 2019

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

@Lanme Lanme changed the title how to test single line after training how to predict single line after training Sep 27, 2019
@crystal0913
Copy link

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)
         ......

@niuweicai
Copy link

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?

@gaozhiguang
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants