Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# -*- coding: utf-8 -*-
"""
@author:XuMing(xuming624@qq.com)
@description:
"""
import numpy as np
import text2vec
text2vec.set_log_level('DEBUG')
char = '我'
result = text2vec.encode(char)
print(type(result))
print(char, result)
word = '如何'
print(word, text2vec.encode(word))
a = '如何更换花呗绑定银行卡'
emb = text2vec.encode(a)
print(a, emb)
b = ['我',
'如何',
'如何更换花呗绑定银行卡',
'如何更换花呗绑定银行卡,如何更换花呗绑定银行卡。如何更换花呗绑定银行卡?。。。这个,如何更换花呗绑定银行卡!']
result = []
for i in b:
import numpy as np
import text2vec
text2vec.set_log_level('DEBUG')
char = '我'
result = text2vec.encode(char)
print(type(result))
print(char, result)
word = '如何'
print(word, text2vec.encode(word))
a = '如何更换花呗绑定银行卡'
emb = text2vec.encode(a)
print(a, emb)
b = ['我',
'如何',
'如何更换花呗绑定银行卡',
'如何更换花呗绑定银行卡,如何更换花呗绑定银行卡。如何更换花呗绑定银行卡?。。。这个,如何更换花呗绑定银行卡!']
result = []
for i in b:
r = text2vec.encode(i)
result.append(r)
print(b, result)
print(np.array(result).shape)
@description:
"""
import numpy as np
import text2vec
text2vec.set_log_level('DEBUG')
char = '我'
result = text2vec.encode(char)
print(type(result))
print(char, result)
word = '如何'
print(word, text2vec.encode(word))
a = '如何更换花呗绑定银行卡'
emb = text2vec.encode(a)
print(a, emb)
b = ['我',
'如何',
'如何更换花呗绑定银行卡',
'如何更换花呗绑定银行卡,如何更换花呗绑定银行卡。如何更换花呗绑定银行卡?。。。这个,如何更换花呗绑定银行卡!']
result = []
for i in b:
r = text2vec.encode(i)
result.append(r)
print(b, result)
print(np.array(result).shape)
print(char, result)
word = '如何'
print(word, text2vec.encode(word))
a = '如何更换花呗绑定银行卡'
emb = text2vec.encode(a)
print(a, emb)
b = ['我',
'如何',
'如何更换花呗绑定银行卡',
'如何更换花呗绑定银行卡,如何更换花呗绑定银行卡。如何更换花呗绑定银行卡?。。。这个,如何更换花呗绑定银行卡!']
result = []
for i in b:
r = text2vec.encode(i)
result.append(r)
print(b, result)
print(np.array(result).shape)