<p>There is no easy way how to do it. <a href="https://arxiv.org/pdf/1607.04606.pdf" rel="nofollow noreferrer">The FastText algorithm</a> uses character-level information, so it can infer embeddings for unseen words. This is what the FastText paper says about representing the words:</p>

<p><a href="https://i.stack.imgur.com/5Yn7Z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5Yn7Z.png" alt="enter image description here"></a></p>

<p>However, this makes sense only in the case of words where you can infer what they mean from knowing the parts. E.g., if you had a reliable embedding for "walk", but not for "walking" and there were plenty of words ending with "ing", FastText would be able to infer the embedding. But this obviously cannot work with words like "Microsoft".</p>

<p>The best thing you can do is train your embeddings on data that contain the words you want the model work with of genre as similar as possible. If your text is in English, tt should not be too difficult.</p>
How to add OOV terms in a word embeddings model
<p>I am using a word embeddings model (FastText via Gensim library) to expand the terms of a search. 
So, basically if the user write "operating system" my goal is to expand that term with very similar terms like "os", "windows", "ubuntu", "software" and so on.</p>

<p>The model works very well but now the time has come to improve the model with "external information", with "external information" i mean OOV (out-of-vocabulary) terms OR terms that do not have good context.</p>

<p>Following the example i wrote above when the user writes <strong>operating system</strong> i would like to expand the query with the "general" terms:</p>

<p>Terms built in the FastText model:</p>

<ul>
<li>windows </li>
<li>ubuntu</li>
<li>software</li>
</ul>

<p><strong>AND</strong> </p>

<p>terms that represent (organizations/companies) like "Microsoft", "Apple" so the complete query will be:</p>

<ul>
<li><strong>term</strong>: operating system</li>
<li><strong>query</strong>: operating system, os, software, windows, ios, Microsoft, Apple</li>
</ul>

<p>My problem is that i DO NOT have companies inside the corpus OR, if present, i do not have to much context to "link" Microsoft to "operating system".</p>

<p>For example if i extract a piece inside the corpus i can read "... i have started working at Microsoft in November 2000 with my friend John ..." so, as you can see, i cannot contextualize "Microsoft" word because i do not have good context, indeed.</p>

<p>A small recap:</p>

<ol>
<li>I have a corpus where the companies (terms) have poor context</li>
<li>I have a big database with companies and the description of what they do.</li>
</ol>

<p>What i need to do:</p>

<p>I would like to include the companies in my FastText model and set "manually" their words context/cloud of related terms.</p>

<p>Ideas?</p>