我使用的是Juypter笔记本,在尝试为scattertext包生成HTML输出时,继续出现错误404:notfound。你知道吗
import scattertext as st
from IPython.display import IFrame
convention_df = st.SampleCorpora.ConventionData2012.get_data()
convention_df["party"].iloc[3] = "liberal"
convention_df["party"].iloc[4] = "republican"
convention_df["party"].iloc[5] = "liberal"
convention_df["party"].iloc[6] = "republican"
empath_corpus = st.CorpusFromParsedDocuments(convention_df.iloc[:15],
category_col="party",
feats_from_spacy_doc=st.FeatsFromOnlyEmpath(),
parsed_col="text").build()
html = st.produce_scattertext_explorer(empath_corpus,
category = 'democrat',
category_name = 'democrat',
not_category_name = "Not democrat",
width_in_pixels=1000,
use_non_text_features=True,
use_full_doc=True)
file_name = 'democrat.html'
rel_report_path = os.path.relpath(file_name)
from IPython.display import IFrame
display(IFrame(filename, width=900, height=650))
Juypter返回404:未找到
从我所看到的HTML文件是生成的,但我不能让它显示出来。我用水蟒。你知道吗
看起来你从来没有写过这个文件。你知道吗
在
file_name = 'democrat.html
下,确保包含以下内容:相关问题 更多 >
编程相关推荐