Skip to content

Instantly share code, notes, and snippets.

@Jian-Qiao
Created August 23, 2017 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jian-Qiao/a2ed76d1f41d71a71811d143b80ecb7a to your computer and use it in GitHub Desktop.
Save Jian-Qiao/a2ed76d1f41d71a71811d143b80ecb7a to your computer and use it in GitHub Desktop.
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