-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
metadata length assertion error #27
Comments
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 If that doesn't work, please try
|
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: