Answers.Body: <ol>
  <li><p>You should use a metric like precision or recall (whatever is more relevant to your use case) that is robust against dataset bias. You may also consider oversampling the minority classes during training.</p>
  </li>
  <li><p>If you ask me, the easiest way to do this would be to convert whole text to embeddings using a pre-trained language model. Then train a small classification MLP on top of those text embeddings.</p>
  </li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-05T01:55:54.313Z
Answers.LastActivityDate: 2023-10-05T01:55:54.313Z
Answers.UserDisplayName: Karl
Answers.Body: <ol>
  <li><p>depends, that imbalance will induce a prior over your model: think about the case of malware detection, where 99% of the files are ok, and 1% are malware... in this case if your model always predicts &quot;non malware&quot;, it has a 99% accuracy, due to the fact that you have a strong prior</p>
  </li>
  <li><p>depends, if you think that such pieces are irrelevant for the classification, you can definitely do that</p>
  </li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-09-28T09:30:01.437Z
Answers.LastActivityDate: 2023-09-28T09:30:01.437Z
Answers.UserDisplayName: Alberto
Body: <p>I have data from our ticketing system. Currently using OpenNLP to create different models.</p>
  <p>For simplicity I have a <strong>10k ticket's text</strong> as category <strong>final queue</strong> of the ticket.</p>
  <p>My questions:</p>
  <ul>
  <li>Is it important for the model to have data similarly distributed?
  <ul>
  <li>eg. for 3 category imagine that 6k items is for 1.cat, 3k is for 2.cat and the rest 1k for 3.cat.</li>
  <li>Will this affect the final classification?</li>
  </ul>
  </li>
  <li>Is it wise to remove a constants from the evaluated text?
  eg. &quot;Good day&quot;, &quot;Best regards&quot; and others?
  <ul>
  <li>Should I already remove such constants from data set for training model or just remove it from text for classification?</li>
  </ul>
  </li>
  </ul>
  
Tags: <machine-learning><natural-language-processing><language-model>
Title: Data preparation for NLP model
UserDisplayName: Milkmaid
ThreadText: # Data preparation for NLP model
  
  (Asked by: username_0 on 2023-09-28)
  
  I have data from our ticketing system. Currently using OpenNLP to create different models.
  
  For simplicity I have a **10k ticket's text** as category **final queue** of the ticket.
  
  My questions:
  
  * Is it important for the model to have data similarly distributed?
    + eg. for 3 category imagine that 6k items is for 1.cat, 3k is for 2.cat and the rest 1k for 3.cat.
    + Will this affect the final classification?
  * Is it wise to remove a constants from the evaluated text?
    eg. "Good day", "Best regards" and others?
    + Should I already remove such constants from data set for training model or just remove it from text for classification?
  
  **Tags:** machine-learning, natural-language-processing, language-model
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2023-10-05. Score: 1 | Accepted answer
  
  1. You should use a metric like precision or recall (whatever is more relevant to your use case) that is robust against dataset bias. You may also consider oversampling the minority classes during training.
  2. If you ask me, the easiest way to do this would be to convert whole text to embeddings using a pre-trained language model. Then train a small classification MLP on top of those text embeddings.
  
  
  ---
  
  ### Answer by username_2 on 2023-09-28. Score: 1
  
  1. depends, that imbalance will induce a prior over your model: think about the case of malware detection, where 99% of the files are ok, and 1% are malware... in this case if your model always predicts "non malware", it has a 99% accuracy, due to the fact that you have a strong prior
  2. depends, if you think that such pieces are irrelevant for the classification, you can definitely do that
  
  
  ---
  
  