title: How to build semantic search for a given domain
body: <p>There is a problem we are trying to solve where we want to do a semantic search on our set of data,
  i.e we have a domain-specific data (example: sentences talking about automobiles)</p>
  
  <p>Our data is just a bunch of sentences and what we want is to give a phrase and get back the sentences which are:</p>
  
  <ol>
  <li>Similar to that phrase</li>
  <li>Has a part of a sentence that is similar to the phrase</li>
  <li>A sentence which is having contextually similar meanings </li>
  </ol>
  
  <p><br/></p>
  
  <p>Let me try giving you an example suppose I search for the phrase "Buying Experience", I should get the sentences like:</p>
  
  <ul>
  <li>I never thought car buying could take less than 30 minutes to sign
  and buy.</li>
  <li><p>I found a car that i liked and the purchase process was<br>
  straightforward and easy</p></li>
  <li><p>I absolutely hated going car shopping, but today i’m glad i did</p></li>
  </ul>
  
  <p><br/>
  I want to lay emphasis on the fact that we are looking for <strong>contextual similarity</strong> and not just a brute force word search.</p>
  
  <p>If the sentence uses different words then also it should be able to find it.</p>
  
  <p>Things that we have already tried:</p>
  
  <ol>
  <li><p><a href="https://www.opensemanticsearch.org/" rel="noreferrer">Open Semantic Search</a> the problem we faced here is generating ontology from the data we have, or
  for that sake searching for available ontology from different domains of our interest.</p></li>
  <li><p>Elastic Search(BM25 + Vectors(tf-idf)), we tried this where it gave a few sentences but precision was not that great. The accuracy was bad
  as well. We tried against a human-curated dataset, it was able to get around 10% of the sentences only.</p></li>
  <li><p>We tried different embeddings like the once mentioned in <a href="https://github.com/UKPLab/sentence-transformers" rel="noreferrer">sentence-transformers</a> and also went through the <a href="https://github.com/UKPLab/sentence-transformers/blob/master/examples/application_semantic_search.p" rel="noreferrer">example</a> and tried evaluating against our human-curated set
  and that also had very low accuracy.</p></li>
  <li><p>We tried <a href="https://towardsdatascience.com/elmo-contextual-language-embedding-335de2268604" rel="noreferrer">ELMO</a>. This was better but still lower accuracy than we expected and there is a
  cognitive load to decide the cosine value below which we shouldn't consider the sentences. This even applies to point 3.</p></li>
  </ol>
  
  <p>Any help will be appreciated. Thanks a lot for the help in advance</p>