output = {'fox': [-0.00449447, -0.00310097]}

input_text = "The quick brown fox"

print(output['fox'])

"""
Explanation: word2vec
<img src="images/book.png" style="width: 300px;" align="middle"/>
Slides: bit.ly/word2vec_talk

Agenda
0) Welcome!  
1) What is word2vec?
2) How does word2vec work?
3) What can you do with word2vec? 
4) Demo(?)    
Slides: bit.ly/word2vec_talk
<img src="images/me_cropped.png" style="width: 300px;"/>
hi, brian. @BrianSpiering
Data Science Faculty @GalvanizeU
Slides: bit.ly/word2vec_talk
(adapted from my Natural Language Processing (NLP) course)

Pop Quiz
Do computers prefer numbers or words?
Numbers
<br>
<br>
word2vec is a series of algorithms to map words (strings) to numbers (lists of floats).
</details>
<img src="images/tsne.png" style="width: 300px;"/>
End of explanation
"""


bigrams = ["insurgents killed", "killed in", "in ongoing", "ongoing fighting"]

skip_2_bigrams = ["insurgents killed", "insurgents in", "insurgents ongoing", "killed in", 
                  "killed ongoing", "killed fighting", "in ongoing", "in fighting", "ongoing fighting"] 

"""
Explanation: Why is word2vec so popular?


Creates a word "cloud", organized by semantic meaning.


Converts text into a numerical form that machine learning algorithms and Deep Learning Neural Nets can then use as input.



<img src="images/firth.png" style="width: 300px;"/>

“You shall know a word
by the company it keeps”
- J. R. Firth 1957

Distributional Hypothesis: Words that occur in the same contexts tend to have similar meanings
Example:  

... government debt problems are turning into banking crises...  
... Europe governments needs unified banking regulation to replace the hodgepodge of debt regulations...

The words: government, regulation, and debt probably represent some aspect of banking since they frequently appear near by.
How does word2vec model the Distributional Hypothesis?
word2Vec is a very simple neural network:
<img src="images/w2v_neural_net.png" style="width: 350px;"/>
Source
Skip-gram architecture
<img src="images/skip-gram.png" style="width: 300px;"/>
Given the current word, predict the context (surrounding words).

Skip-gram example

“Insurgents killed in ongoing fighting”
End of explanation
"""


