title: Python: Semantic similarity score for Strings
body: <p>Are there any libraries for computing semantic similarity scores for a pair of sentences ?</p>
  
  <p>I'm aware of WordNet's semantic database, and how I can generate the score for 2 words, but I'm looking for libraries that do all pre-processing tasks like port-stemming, stop word removal, etc, on whole sentences and outputs a score for how related the two sentences are.</p>
  
  <p>I found a <a href="http://www.codeproject.com/Articles/11835/WordNet-based-semantic-similarity-measurement" rel="noreferrer">work</a> in progress that's written using the .NET framework that computes the score using an array of pre-processing steps.
  Is there any project that does this in python?</p>
  
  <p>I'm not looking for the sequence of operations that would help me find the score (as is asked for <a href="https://stackoverflow.com/questions/11463396/using-wordnet-to-determine-semantic-similarity-between-two-texts/11463726#11463726">here</a>)<br> 
  I'd love to implement each stage on my own, or glue functions from different libraries so that it works for sentence pairs, but I need this mostly as a tool to test inferences on data.</p>
  
  <hr>
  
  <p><strong>EDIT:</strong> I was considering using NLTK and computing the score for every pair of words iterated over the two sentences, and then draw inferences from the standard deviation of the results, but I don't know if that's a legitimate estimate of similarity. Plus, that'll take a LOT of time for long strings.<br>
  Again, I'm looking for projects/libraries that already implement this intelligently. Something that lets me do this:</p>
  
  <pre><code>import amazing_semsim_package
  str1='Birthday party ruined as cake explodes'
  str2='Grandma mistakenly bakes cake using gunpowder'
  
  &gt;&gt;similarity(str1,str2)
  &gt;&gt;0.889
  </code></pre>