Python 部署用于情绪分析的ml模型uging Streamlight时出错

Python 部署用于情绪分析的ml模型uging Streamlight时出错,python,streamlit,Python,Streamlit,有人能帮我找出这个代码的问题吗? 当我在wine review上运行情绪分析代码时 %%writefile app1.py import streamlit as st import pandas as pd import numpy as np from sklearn.pipeline import Pipeline from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.naive_bayes imp

有人能帮我找出这个代码的问题吗? 当我在wine review上运行情绪分析代码时

%%writefile app1.py
import streamlit as st
import pandas as pd
import numpy as np
from sklearn.pipeline import Pipeline
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.naive_bayes import MultinomialNB

df = pd.read_table('/content/drive/My Drive/wine_review/file1.csv')
x = df['description'] # Message column as input
y = df['quality'] # Label column as output
st.title("Wine Review Classifier")
st.subheader('TFIFD Vectorizer')
st.write('This project is based on Naive Bayes Classifier')

text_model = Pipeline([('tfidf',TfidfVectorizer()),('model',MultinomialNB())])
text_model.fit(x,y)
message = st.text_area("Enter Text","Type Here ..")
op = text_model.predict([[message]])
if st.button("Predict"):
  st.title(op)
我面临着这个错误

KeyError:'description'
回溯:
文件“/usr/local/lib/python3.6/dist packages/streamlit/script\u runner.py”,第324行,在脚本中
exec(代码、模块、指令)
文件“/content/app1.py”,第9行,在
x=df['description']#消息列作为输入
文件“/usr/local/lib/python3.6/dist-packages/pandas/core/frame.py”,第2902行,在__
indexer=self.columns.get_loc(键)
文件“/usr/local/lib/python3.6/dist-packages/pandas/core/index/base.py”,第2893行,在get_loc中

从err升起KeyError(key)
一个KeyError告诉您数据帧中没有列
说明
。使用df.columns查看数据帧的列名。