<p>Yes, but you'd want to train the <code>Doc2Vec</code> model on a large set of documents which contains the full range of document topics you want to represent – such as all Wikipedia articles – rather than just on one document. </p>

<p>Then, if the documents you want to compare were named in the training set, you can look up their vectors from the model. But if they're new documents using similar language, you can use the <code>Doc2Vec.infer_vector()</code> method on their word-tokens (which should be preprocessed/tokenized the same as the training data was).</p>

<p>It seems in your question, you've picked two documents that are known to be somewhat-similar – perhaps because they share the same human-assigned category – and then a 3rd at random, with the hopes a model will properly determine the 1st two are more-similar to each-other than the 3rd. </p>

<p>Doing that over a large set of document-triples is a good model-evaluation process! In fact, in the followup paper to the original 'Paragraph Vector' (<code>Doc2Vec</code>) work, that's what's used to evaluate and parameter-optimize the algorithm, against both Wikipedia and Arxiv document corpuses. See:</p>

<p><a href="https://arxiv.org/abs/1507.07998" rel="nofollow noreferrer">Document Embedding with Paragraph Vectors</a> </p>
How to generate a similarity score for two documents
<p>I would like to compare two documents semantically and generate a similarity score. The following docs are from wikipedia and when compare them, I expect to see a higher score for world_1 and world_2 as they have similar context.</p>

<p>Would training a Doc2vec model on "world_1" and testing other two docs with that model be a good approach? </p>

<p>thermo = "Thermodynamics is principally based on a set of four laws which are universally valid when applied to systems that fall within the constraints implied by each. In the various theoretical descriptions of thermodynamics these laws may be expressed in seemingly differing forms, but the most prominent formulations are the following:Zeroth law of thermodynamics:If two systems are each in thermal equilibrium with a third, they are also in thermal equilibrium with each other.This statement implies that thermal equilibrium is an equivalence relation on the set of thermodynamic systems under consideration."</p>

<p>world_1 = "World War I (often abbreviated as WWI or WW1), also known as the First World War or the Great War, was a global war originating in Europe that lasted from 28 July 1914 to 11 November 1918. Contemporaneously described as the war to end all wars,[7] it led to the mobilisation of more than 70 million military personnel, including 60 million Europeans, making it one of the largest wars in history.[8][9] It is also one of the deadliest conflicts in history,[10] with an estimated nine million combatants and seven million civilian deaths as a direct result of the war, while resulting genocides and the 1918 influenza pandemic caused another 50 to 100 million deaths worldwide. On 28 June 1914, Gavrilo Princip, a Bosnian Serb Yugoslav nationalist, assassinated the Austro-Hungarian heir Archduke Franz Ferdinand in Sarajevo, leading to the July Crisis."</p>

<p>world_2 = "World War II (often abbreviated to WWII or WW2), also known as the Second World War, was a global war that lasted from 1939 to 1945. The vast majority of the world's countries—including all the great powers—eventually formed two opposing military alliances: the Allies and the Axis. A state of total war emerged, directly involving more than 100 million people from over 30 countries. The major participants threw their entire economic, industrial, and scientific capabilities behind the war effort, blurring the distinction between civilian and military resources. World War II was the deadliest conflict in human history, marked by 50 to 85 million fatalities, most of whom were civilians in the Soviet Union and China."</p>