I'm not sure exactly about the final goal of your "similarity of context", but here are some first ideas to help you search and find (and please keep in mind that I'm definitely not a NLP expert, I'M just trying to help) :
Google open-sourced their language parser. The goal here is more ambitious: it's not comparing a sentence with another, but rather to adress the problem of NLU... although the ideas and solutions could give you ideas: googleresearch.blogspot.ca/2016/05/announcing-syn…
more basically, word2vec is also openssourced and really targets at understanding words within a context : blog.acolyer.org/2016/04/21/the-amazing-power-of-…
between the two, a paper came out recently that describes lda2vec gitxiv.com/posts/BnQYniYBjhdwdYwtR/lda2vec-mixing…
There's huge amount of scholarly papers on the subject, but these first one could give you a start.
HTH, Séb