Answers.Body: <p>It depends what you mean by "comparison", but in general I would think not really.</p>
  
  <p>Neural networks operate on the sub-symbolic level, ie instead of handling discrete symbols (such as letters) they work with numerical values. These values can often be mapped onto symbols (eg through input or output nodes) which typically are letters or words.</p>
  
  <p>If you want to compare texts, you are dealing with symbols, so it would probably be easier to operate on the symbolic level, by manipulating words directly, rather than translating them into numerical values and back, as that usually involves some loss of precision.</p>
  
  <p>But as I said, it is hard to answer your question without knowing more detail about the exact nature of the comparison you're after.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-01-19T19:52:17.107Z
Answers.Text: I edited the original question to include the example given in the comment by the OP and to try to clarify the question. So, if you have some time, given that this question has a lot of views, I would suggest that you review your answer and try to address the current version of the question more directly. Feel free to edit again the question to make it more "meaningful" and clearer.
Answers.UserDisplayName: nbro
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-08T08:35:53.817Z
Answers.LastActivityDate: 2018-05-08T08:35:53.817Z
Answers.UserDisplayName: Oliver Mason
Answers.Body: <p>There are more than 1 way of doing this:</p>
  
  <ol>
  <li>You can compute the bleu score between them if you are looking at the quality of machine translation. Check this <a href="https://en.wikipedia.org/wiki/BLEU" rel="nofollow noreferrer">link</a>.</li>
  <li>You can convert them into 2 vectors using doc2vec and find the similarity between the vectors using cosine similarity.</li>
  <li><a href="https://www.researchgate.net/profile/Maarten_Versteegh/publication/304834009_Learning_Text_Similarity_with_Siamese_Recurrent_Networks/links/577c2e5d08aec3b743367064/Learning-Text-Similarity-with-Siamese-Recurrent-Networks.pdf?origin=publication_detail" rel="nofollow noreferrer">Siamese networks</a> are something similar to what you are asking. They are neural nets that use distance metric for learning rather than a loss metric.</li>
  </ol>
  
  <p>I don't understand why do you want to use neural network for comparing two text pieces. Generally comparisons are done by some of the distance metrics not by neural network.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-14T10:20:13.727Z
Answers.LastActivityDate: 2018-05-14T11:07:11.837Z
Answers.LastEditDate: 2018-05-14T11:07:11.837Z
Answers.UserDisplayName: varsh
Body: <p>How can we compare, in terms of similarity (and/or meaning), two pieces of text (or documents)?</p>
  <p>For example, let's say that I want to determine whether a document is a plagiarized version of another document. Which approach should I use? Could I use neural networks to do this? Or are there other more suitable approaches?</p>
  
Tags: <neural-networks><natural-language-processing><metric><similarity>
Title: How can we compare, in terms of similarity, two pieces of text?
UserDisplayName: cuong tran
ThreadText: # How can we compare, in terms of similarity, two pieces of text?
  
  (Asked by: username_0 on 2018-05-07)
  
  How can we compare, in terms of similarity (and/or meaning), two pieces of text (or documents)?
  
  For example, let's say that I want to determine whether a document is a plagiarized version of another document. Which approach should I use? Could I use neural networks to do this? Or are there other more suitable approaches?
  
  **Tags:** neural-networks, natural-language-processing, metric, similarity
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2018-05-14. Score: 3 | Accepted answer
  
  There are more than 1 way of doing this:
  
  1. You can compute the bleu score between them if you are looking at the quality of machine translation. Check this [link](https://en.wikipedia.org/wiki/BLEU).
  2. You can convert them into 2 vectors using doc2vec and find the similarity between the vectors using cosine similarity.
  3. [Siamese networks](https://www.researchgate.net/profile/Maarten_Versteegh/publication/304834009_Learning_Text_Similarity_with_Siamese_Recurrent_Networks/links/577c2e5d08aec3b743367064/Learning-Text-Similarity-with-Siamese-Recurrent-Networks.pdf?origin=publication_detail) are something similar to what you are asking. They are neural nets that use distance metric for learning rather than a loss metric.
  
  I don't understand why do you want to use neural network for comparing two text pieces. Generally comparisons are done by some of the distance metrics not by neural network.
  
  
  ---
  
  ### Answer by username_1 on 2018-05-08. Score: 1
  
  It depends what you mean by "comparison", but in general I would think not really.
  
  Neural networks operate on the sub-symbolic level, ie instead of handling discrete symbols (such as letters) they work with numerical values. These values can often be mapped onto symbols (eg through input or output nodes) which typically are letters or words.
  
  If you want to compare texts, you are dealing with symbols, so it would probably be easier to operate on the symbolic level, by manipulating words directly, rather than translating them into numerical values and back, as that usually involves some loss of precision.
  
  But as I said, it is hard to answer your question without knowing more detail about the exact nature of the comparison you're after.
  
  > **Comments:**
  > **username_2**: I edited the original question to include the example given in the comment by the OP and to try to clarify the question. So, if you have some time, given that this question has a lot of views, I would suggest that you review your answer and try to address the current version of the question more directly. Feel free to edit again the question to make it more "meaningful" and clearer.  
  
  ---
  
  