You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am getting the following assertion error when I include the metadata parameter.
assert len(metadata) == len(data['labels'])
I am not sure I understand the error. When I check, the length of the column I am using as my metadata is the same as the length of my label column. Is there anything else I should be checking?
When I test the demo program I get no error.
Here is some relevant code:
corpus = st.CorpusFromPandas(df, category_col='binary_bias', text_col='content',nlp=nlp).build()
html = st.produce_scattertext_explorer(corpus,category='left',category_name='Left',not_category_name='Right',width_in_pixels=1000,metadata=df['topic'])
The text was updated successfully, but these errors were encountered:
This error crops up when documents are either empty or composed of very infrequent tokens. I'm working on fixing this, but in the meantime, please try a couple things:
Instead of metadata=df['topic'], try metadata=corpus.get_df()['topic'].
Hi, I am getting the following assertion error when I include the metadata parameter.
assert len(metadata) == len(data['labels'])
I am not sure I understand the error. When I check, the length of the column I am using as my metadata is the same as the length of my label column. Is there anything else I should be checking?
When I test the demo program I get no error.
Here is some relevant code:
corpus = st.CorpusFromPandas(df, category_col='binary_bias', text_col='content',nlp=nlp).build()
html = st.produce_scattertext_explorer(corpus,category='left',category_name='Left',not_category_name='Right',width_in_pixels=1000,metadata=df['topic'])
The text was updated successfully, but these errors were encountered: