<p>The current usage of machine learning methods such as <code>word2vec</code> and <code>dl4j</code> for modelling words are based on <a href="http://www.aclweb.org/aclwiki/index.php?title=Distributional_Hypothesis" rel="nofollow noreferrer">distributional hypothesis</a>. They train models of words and phrases based on their context. There is no ontological aspects in these word models. At its best trained case a model based on these tools can say if two words can appear in similar contexts. That is how their similarity measure works.</p>
<p>The Mikolov papers (<a href="http://arxiv.org/pdf/1301.3781.pdf" rel="nofollow noreferrer">a</a>, <a href="http://arxiv.org/pdf/1310.4546.pdf" rel="nofollow noreferrer">b</a> and <a href="http://research.microsoft.com/pubs/189726/rvecs.pdf" rel="nofollow noreferrer">c</a>) which suggests that these models can learn &quot;Linguistic Regularity&quot; doesn't have any ontological test analysis, it only suggests that these models are capable of predicting &quot;similarity between members of the word pairs&quot;. This kind of prediction doesn't help your task. These models are even incapable of recognising <em>similarity</em> in contrast with <em>relatedness</em> (e.g. read this page <a href="http://www.cl.cam.ac.uk/%7Efh295/simlex.html" rel="nofollow noreferrer">SimLex test set</a>).</p>
<p>I would say that you need an ontological database to solve your problem. More specifically about your examples, it seems for <code>String 1</code> and <code>String 2</code> in your examples:</p>
<pre><code>String 1 = &quot;a&quot;
String 2 = &quot;b&quot;
</code></pre>
<p>You are trying to check <a href="https://en.wikipedia.org/wiki/Entailment_(pragmatics)" rel="nofollow noreferrer">entailment</a> relations in sentences:</p>
<blockquote>
<p>(1) &quot;<em>c</em> is <em>b</em>&quot;</p>
<p>(2) &quot;<em>c</em> is <em>a</em>&quot;</p>
<p>(3) &quot;<em>c</em> is related to <em>a</em>&quot;.</p>
</blockquote>
<p>Where:</p>
<blockquote>
<p>(1) entails (2)</p>
</blockquote>
<p>or</p>
<blockquote>
<p>(1) entails (3)</p>
</blockquote>
<p>In your two first examples, you can probably use semantic knowledge bases to solve the problem. But your third example will probably need a syntactical parsing before understanding the difference between two phrases. For example, these phrases:</p>
<blockquote>
<p>&quot;men&quot;</p>
<p>&quot;all men&quot;</p>
<p>&quot;tall men&quot;</p>
<p>&quot;men in black&quot;</p>
<p>&quot;men in general&quot;</p>
</blockquote>
<p>It needs a logical understanding to solve your problem. However, you can analyse that based on <em>economy of language</em>, adding more words to a phrase usually makes it <em>less general</em>. Longer phrases are less general comparing to shorter phrases. It doesn't give you a precise tool to solve the problem, but it can help to analyse some phrases without special words such as <code>all</code>, <code>general</code> or <code>every</code>.</p>
semantic matching strings - using word2vec or s-match?
<p>I have this problem of matching two strings for 'more general', 'less general', 'same meaning', 'opposite meaning' etc.</p>

<p>The strings can be from any domain. Assume that the strings can be from people's emails. </p>

<p>To give an example, </p>

<pre><code>String 1 = "movies"
String 2 = "Inception"
</code></pre>

<p>Here I should know that Inception is less general than movies (sort of is-a relationship)</p>

<pre><code>String 1 = "Inception"
String 2 = "Christopher Nolan"
</code></pre>

<p>Here I should know that Inception is less general than Christopher Nolan </p>

<pre><code>String 1 = "service tax"
String 2 = "service tax 2015"
</code></pre>

<p>At a glance it appears to me that S-match will do the job. But I am not sure if S-match can be made to work on knowledge bases other than WordNet or GeoWordNet (as mentioned in their page). </p>

<p>If I use <code>word2vec</code> or <code>dl4j</code>, I guess it can give me the similarity scores. But does it also support telling a string is <code>more general</code> or <code>less general</code> than the other?</p>

<p>But I do see word2vec can be based on a training set or large corpus like wikipedia etc.</p>

<p>Can some one throw light on the way to go forward?</p>