0
$\begingroup$

I am looking at a problem where I have two documents, both are textual documents. The first one is a long (few pages long) textual document, while the second one contains about 10 short texts, each being a one liner. The problem is to automatically understand the 1st document and "map" key ideas from here to one or more short texts in the second document. I am not being able to get a good grip on the problem as to how to proceed. I tried the following approach:

first collected as much similar documents as possible which are relevant; I have obtained 136 such documents, each few pages long. Then build a document level embedding using each sentence as a document (doc2vec). Then for each short sentence in the second document, inferred an embedding based on the document model I built. Then tried to find the most similar sentences for each of these short texts from the 2nd document. However the results are not good. Only about 30% match is what I am getting and the corresponding sentences are not much related to the target sentence.

I am wondering if this is the right approach or are there any other approach available which I am not aware of.

Your advice would be greatly appreciated. It may be the case that my explanation above is not adequate. Please let me know and I will try to improve it.

Your input would be greatly appreciated.

Thanks

$\endgroup$
1
$\begingroup$

Instead of using embeddings and doc2vec, maybe you should start by an easier and more straightforward information retrieval approach. Start by building a bag-of-words representation of your long document. Given its vocabulary $V$ of size $|V|$, you represent it as well as the short texts for the second document in a space $\mathbb{R}^{|V|}$. This will give a vector for the first document and several vectors, one for each of the lines, for the second document.

Proceed by calculating the similarity (euclidean distance) of the vectors of the lines of the second document with the vector of the first document.

There are many ways in this line of though that would enable you to use word embeddings if you want, but I would suggest starting with the simplest approach first.

| improve this answer | |
$\endgroup$
  • $\begingroup$ Thanks for your comment. These vectors will be {0,1} vectors I believe. I can certainly do that. I have couple of concerns. 1st, some of the words in the 2nd doc may not be present as is in the first document (may be a synonym); 2nd, I have found sentences that are constructed with a negative connotation in the 2nd doc. Do you know of work that will take care of these discrepancy? Thanks again. $\endgroup$ – user62198 Jan 16 '18 at 18:41
  • $\begingroup$ It can be vectors with binary values (a word exists or not), discrete values (how many times a word exists) or continuous (idf weighting scheme). The negative connotation is tricky. For synonyms you can try expanding with WordNet etc. but start for basics. Also, a simple example would help. $\endgroup$ – geompalik Jan 17 '18 at 8:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.