首页 > 编程知识 正文

python字符串相似度匹配算法,竟然的竟还能组什么词

时间:2023-05-05 09:13:36 阅读:10056 作者:680

#利用维基培训的模式,将完成词翻译为importtensorflow _ hubashubembed=hub.load (https://TF hub.dev/Google/wiki-words-5009 English_Sentences=['dog ',' Puppies are nice.',' ienjoytakinglongwalksalongthebeachwithmydog.' ] English _ embeded print(English_embedding.shape ) ` ` ` ` ` ` ` ` python# ) #第二个单词是, 模型代码importtensorflow _ hubashubimportnumpyasnpimporttensorflow (hubashubimportnumpyasnpimporttenso sometextsofdifferentlentlenglow ' Puppies are nice.',' ienjoytakinglongwalksalongthebeachwithmydog.' ] Italian _ sentences=[ ' cane ',' I cuccio Li sono sono ' mipiacefarelunghepasseggiatelungolaspiaggiaconilmiocane.' ] Chinese _ sentences=[ '狗','狗友好', '我喜欢和狗一起散步' ] embed=hub.load (https://TF hub.dev/Google/universal-sentence-encoder-multilingual/3 ' ) ) ) ) ) ) ) ) computeembeddings.en _ result=embed (English _ sentences ) it_result=embed ) italilition dicatesgreatersimilarity.similarity _ matrix _ it=NP.inner (en _ result,it

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。