question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] Product Classification By Text

See original GitHub issue

Hi,

this is more of a question than a problem/bug.

We are trying to categorise/classify products in our database by their title. And we are doing this by training with a dictionary that we build ourselves for this purpose:

{
  apparel: ['shirt', 'pants', 'shorts', ...],
  shoes: ['shoe', 'shoes', 'laces', ...],
  ...
}

So the idea is to train the net in a way that whenever it sees one of these words in a product’s title it will classify the product accordingly (or more words from one of same category (apparel, shoes, …) are present).

We’ve tried a brain.NeuralNet, brain.recurrent.LSTM as well as brain.NeuralNet in combination with a node text classifier: https://github.com/NaturalNode/natural#classifiers Nothing really seems to deliver satisfying results, however. brain.NeuralNet seems to lead nowhere as it is super slow and might take month or so to compute. The text classifier variation trains unbelievably fast and achieves a 0.005 error rate really quickly but the resulting net delivers wrong results 90% of the time.

The best results so far have been with brain.recurrent.LSTM, but even after about 15k of iterations the error rate stays above ~ 0.026.

So, my question now is (actually multiple):

  • Is there a better way to go about this?
  • Do I just need more time and training to get a better error rate?
  • Is there maybe a solution to this particular problem employing brain.js already that I’m just not aware of?

If someone with more experience in ML could point us into the right direction we’d be super happy 😃

Thanks a lot, Chris

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
robertleeplummerjrcommented, Sep 7, 2019

This is, I think, related to this answer: https://github.com/BrainJS/brain.js/issues/434#issuecomment-528480859

You could try the solution outlined there (bag of words model), and let us know your findings.

0reactions
cspeercommented, Jul 1, 2019

We did not really deviate from the default config. We played around with hiddenLayers for a bit and tried using relu as the LSTM activation function, but that’s about it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Text Classification: What it is And Why it Matters - MonkeyLearn
Text classification is a machine learning technique that assigns a set of predefined categories to text data. Text classification is used to organize, ......
Read more >
nlp - Product classification according to description
So the question is what should the training and test sets consist of for classifying products by their product description.
Read more >
Classifying Products as Banned Or Approved using Text ...
Product Classification as Banned or Approved based on textual information available against it. Classifying products as Approved or Rejected ...
Read more >
What is Text Classification? - Hugging Face
Text Classification is the task of assigning a label or class to a given text. Some use cases are sentiment analysis, natural language...
Read more >
9 Text Classification Examples in Action - Levity.ai
1. Use text classification for social listening · 2. Categorizing customer support tickets · 3. Customer feedback sentiment analysis · 4. Product ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found