Created
August 23, 2017 16:36
-
-
Save Jian-Qiao/a2ed76d1f41d71a71811d143b80ecb7a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def my_docu_in_search(sentence, docu): | |
wf=[] | |
for word in sentence.split(): | |
wf.append((np.array(docu.split())==[word]).sum()/1.0/len(docu.split())) | |
return np.array(wf).sum() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment