我有一个用Electron和AngularJs制作的独立应用程序。
我想发出一些HttpRequest之类的
from __future__ import with_statement
import gensim.downloader as api
from gensim.models import TfidfModel
from gensim.corpora import Dictionary
import string
import codecs
dataset = api.load("test8")
dct = Dictionary(dataset) # fit dictionary
corpus = [dct.doc2bow(line) for line in dataset] # convert corpus to BoW format
model = TfidfModel(corpus) # fit model
######### validate model
vector = model[corpus[0]] # apply model to the first corpus document
sortvec = sorted(vector,reverse=True, key = lambda x: x[1]) #sort by TF-IDF descending
x = [item[0] for item in sortvec] #take the indices Descending on TF-IDF probability
cnt=0
y={}
##########passing to a dictionary the pairs corresponding to the indices above
for a in x:
y[cnt] = dct[a];
cnt+=1
first15pairs = y.values()[:15] #get top 15 words with highest probabilities from dictionary
d = [[s.encode('ascii','ignore')] for s in first15pairs]
print d
但是由于407代码(代理身份验证),我无法到达某些端点
我想知道是否有办法通过Electron绕过它, 像这样写:
dataset = api.load("wiki-english-20171001")
非常感谢您