簡體   English   中英

通過潛在語義分析建立索引的問題

[英]Problems with Indexing by Latent Semantic Analysis

每當我嘗試在安裝了python 2.6.6的Windows 7 Enterprise(64位)中運行此python腳本時,都會不斷出現此錯誤

問題簽名:問題事件名稱:APPCRASH
應用名稱:python.exe
應用版本:0.0.0.0
應用時間戳:4c73f7b6
故障模塊名稱:_csr.pyd
故障模塊版本:0.0.0.0
故障模塊時間戳:4d6a645b
異常代碼:c0000005
異常偏移量:000c05d4

我嘗試重新安裝python及其程序運行的所有模塊(即gensim,nlptk,scipy和numpy)

我不知道這對於你們來說是否足夠的數據,但是請讓我知道!

lsi = models.LsiModel(corpus, num_topics = num_Topics)
index_lsi = similarities.MatrixSimilarity(lsi[corpus])

for k, v in dict_Queries.items():
        File.write("Check Key: " +k+ "\n")
        print "Running.... \n" 
        vec_bow = dict.doc2bow(v.split(), allow_update=True)

#In the last iteration, the code below the line doesn't run and i think the vec_lsi  
#is the source of the problem but I don't know why?
        vec_lsi = lsi[vec_bow]

        #indexing the LSI
        sims = index_lsi[vec_lsi]
        sims = sorted(enumerate(sims), key = lambda item: -item[1])

        if not cut_Off == 0:
            sims = sims[0:cut_Off]
        else:
            pass

        for t in sims:

            dup_info = dict_tcs.get(t[0])

            if t[1] > 0.75:
                #print "Key: " + k + " Link: " + dup_info + "\n"
                File.write("Adding: "+str(t)+ " To LSI actual \n")
                if dict_Actual_LSI.has_key(k):
                    links = dict_Actual_LSI.get(k)
                    links.append(dup_info)
                else:
                    links = []
                    links.append(dup_info)
                    dict_Actual_LSI[k] = links
        print "Added\n"

在最后一次迭代中,該行下面的代碼未運行,我認為vec_lsi是問題的根源,但我不知道為什么?

謝謝

異常代碼c0000005表示“訪問沖突”。 通常,這意味着某些代碼試圖讀取或寫入沒有訪問權限的內存地址。 這可能是由於指針損壞,未初始化的內存或本機代碼索引超出了數組的范圍。

故障所在的模塊是_csr.pyd。 這是SciPy的一部分,聽起來像是用於處理稀疏數組。 這可能表明該錯誤正在發生,因為SciPy已經以某種方式指向了無效的內存。 如果不看程序,很難猜測這是怎么發生的。

下一步,您可以嘗試通過在程序中添加一些打印語句來確定崩潰之前發生的事情-通過打印其進度,您可以縮小崩潰發生的位置。 如果幸運的話,這可能會很清楚為什么SciPy試圖訪問無效的內存。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM