第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

嘗試在 Keras 中標(biāo)記文本時(shí)出現(xiàn)空格錯(cuò)誤

嘗試在 Keras 中標(biāo)記文本時(shí)出現(xiàn)空格錯(cuò)誤

蕪湖不蕪 2021-09-25 14:40:27
我有一個(gè)包含 2 列的數(shù)據(jù)框。第一列 (content_cleaned) 包含保存句子的行。第二列(有意義的)包含相關(guān)聯(lián)的二進(jìn)制標(biāo)簽。當(dāng)我嘗試標(biāo)記 content_cleaned 列中的文本時(shí),我遇到的問題是空格。到目前為止,這是我的代碼:df = pd.read_csv(pathname, encoding = "ISO-8859-1")df = df[['content_cleaned', 'meaningful']]df = df.sample(frac=1)#Transposed columns into numpy arrays X = np.asarray(df[['content_cleaned']])y = np.asarray(df[['meaningful']])#Split into training and testing setX_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=21) # Create tokenizertokenizer = Tokenizer(num_words=100) #No row has more than 100 words.#Tokenize the predictors (text)X_train = tokenizer.sequences_to_matrix(X_train.astype(np.int32), mode="binary")X_test = tokenizer.sequences_to_matrix(X_test.astype(np.int32), mode="binary")#Convert the labels to the binaryencoder = LabelBinarizer()encoder.fit(y_train) y_train = encoder.transform(y_train)y_test = encoder.transform(y_test)錯(cuò)誤突出顯示的代碼行是:X_train = tokenizer.sequences_to_matrix(X_train.astype(np.int32), mode="binary")錯(cuò)誤信息是:invalid literal for int() with base 10: "STX's better than reported quarter is likely to bode well for WDC results."“base 10:”之后的句子是包含文本的列中的行之一的示例。那將是我試圖標(biāo)記的例句。我被認(rèn)為這是 NumPy 的問題,但我也確信這可能是我標(biāo)記此文本數(shù)組的方法中的錯(cuò)誤。任何幫助都會(huì)很棒!
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 204 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)