-
Notifications
You must be signed in to change notification settings - Fork 265
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
Using the classifier #5
Comments
@davidniki02
|
@lyeoni thanks, but I think we also need to store the tokenizer? I stored it using pickle. Here is my code but it predicts the same category all the time:
|
It depends on what kind of tokenizer you use.
|
Thanks @lyeoni,
The problem is it predicts the same category all the time (with the same Huffpost dataset you have used) |
Any luck, @lyeoni ? |
Sorry for the delay in replying, The reason why I used 2 tokenizers(MosesTokenizer, Keras tokenizer) is:
@davidniki02, |
Thanks for replying @lyeoni Here is the latest not working code:
I probably need to use keras tokenizer to convert it to numbers (and get rid of the numpy array), e.g.
but I don't know if reload the corpus and concatenate the new text to it, if I need to fit_text etc.
It's getting a bit confusing. Can you show how the code should actually look? |
In your code, tokenizer is initialized/fit every time.
And, you don't have to use MosesTokenizer because Keras Tokenizer work enough well.
|
Thanks @lyeoni , that is exactly the part I don't get: But using the tokenizer to transform a new text (hence the |
@lyeoni, I think I got it right this time:
That being said, it seems the predictions get really off sometimes. I have trained them on the headlines which yields a higher accuracy than summaries (80%) but when tested against something like "Facebook Accused Of Reading Texts And Accessing Microphones In Lawsuit" (which is even in the News dataset) the answer is "POLITICS" What results do you get? How accurate is the model? |
Hi
After saving the model in news-category-classification, how do you actually use it to predict text classification?
Can you put up an example, please?
The text was updated successfully, but these errors were encountered: