Answers.Body: <p>Siamese networks may be useful in your case.</p>
  <p><a href="http://www.cs.cmu.edu/%7Ersalakhu/papers/oneshot1.pdf" rel="nofollow noreferrer">http://www.cs.cmu.edu/~rsalakhu/papers/oneshot1.pdf</a></p>
  <p><a href="https://en.wikipedia.org/wiki/Siamese_neural_network" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Siamese_neural_network</a></p>
  <p><a href="https://link.springer.com/protocol/10.1007%2F978-1-0716-0826-5_3" rel="nofollow noreferrer">https://link.springer.com/protocol/10.1007%2F978-1-0716-0826-5_3</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-08T18:55:28.487Z
Answers.Text: Thank you very much! It seems really useful. I hope it works on my text data as well considering the texts in my datasets are kind of messy complaint data.
Answers.UserDisplayName: Fara
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-08T12:33:48.657Z
Answers.LastActivityDate: 2021-02-08T12:33:48.657Z
Answers.UserDisplayName: user31264
Body: <p>I have a dataset of texts, each text was identified with an ID number. I would like to do a prediction by finding the best match ID number for upcoming new texts. To use multi text classification, I am not sure if this is the right approach since there is only one text for most of ID numbers. In this case, I wouldn't have any test set. Can up-sampling help? Or is there any other approach than classification for such a problem?</p>
  <p>The data set looks like this:</p>
  <p>id1 'text1', id2 'text2', id3 'text3', id3 'text4', id3 'text5', id4 'text6', . . id200 'text170'</p>
  <p>I would appreciate any guidance to find the best approach for this problem.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-03-11T02:40:24.727Z
Comments.Text: won't be able to classify if there are too many kinds of ids
Comments.UserDisplayName: Dan D.
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-03-11T02:43:11.183Z
Comments.Text: and theoretically, won't be able to classify, if the data are singlesample --to--> multiple ids; it must be manysamples --to--> single id
Comments.UserDisplayName: Dan D.
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-11-01T12:16:45.190Z
Comments.Text: If your texts are simple (have same words/phrases/subparts) then approaches like edit distance might work (levenshtein distance or any similar thing). If they are more complex, such as different words but similar meaning, then you can use pretrained models like Bert and use them to get embeddings and classify based on distance of embeddings
Comments.UserDisplayName: SajanGohil
Tags: <prediction><text-classification><imbalanced-datasets><multiclass-classification>
Title: Multi class text classification when having only one sample for classes
UserDisplayName: Fara
ThreadText: # Multi class text classification when having only one sample for classes
  
  (Asked by: username_0 on 2021-02-07)
  
  I have a dataset of texts, each text was identified with an ID number. I would like to do a prediction by finding the best match ID number for upcoming new texts. To use multi text classification, I am not sure if this is the right approach since there is only one text for most of ID numbers. In this case, I wouldn't have any test set. Can up-sampling help? Or is there any other approach than classification for such a problem?
  
  The data set looks like this:
  
  id1 'text1', id2 'text2', id3 'text3', id3 'text4', id3 'text5', id4 'text6', . . id200 'text170'
  
  I would appreciate any guidance to find the best approach for this problem.
  
  **Tags:** prediction, text-classification, imbalanced-datasets, multiclass-classification
  > **Comments:**
  > **username_1**: won't be able to classify if there are too many kinds of ids  
  > **username_1**: and theoretically, won't be able to classify, if the data are singlesample --to--> multiple ids; it must be manysamples --to--> single id  
  > **username_2**: If your texts are simple (have same words/phrases/subparts) then approaches like edit distance might work (levenshtein distance or any similar thing). If they are more complex, such as different words but similar meaning, then you can use pretrained models like Bert and use them to get embeddings and classify based on distance of embeddings  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2021-02-08. Score: 0
  
  Siamese networks may be useful in your case.
  
  [http://www.cs.cmu.edu/~rsalakhu/papers/oneshot1.pdf](http://www.cs.cmu.edu/%7Ersalakhu/papers/oneshot1.pdf)
  
  <https://en.wikipedia.org/wiki/Siamese_neural_network>
  
  <https://link.springer.com/protocol/10.1007%2F978-1-0716-0826-5_3>
  
  > **Comments:**
  > **username_0**: Thank you very much! It seems really useful. I hope it works on my text data as well considering the texts in my datasets are kind of messy complaint data.  
  
  ---
  
  