Closed vaidyan5 closed 4 years ago
Thanks for linking to your data. What’s needed is a code snippet that I can on the latest version of Scattertext (0.0.2.59) that reproduces this error
I believe that I had included the code snippet with the github post
On Sat, Mar 14, 2020 at 4:09 PM Jason S. Kessler notifications@github.com wrote:
Thanks for linking to your data. What’s needed is a code snippet that I can on the latest version of Scattertext (0.0.2.59) that reproduces this error
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JasonKessler/scattertext/issues/52#issuecomment-599129376, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJD6M7GNHQTYUUMZBX5E5BDRHPP65ANCNFSM4LHG7IWQ .
import scattertext as st import spacy from pprint import pprint nlp = spacy.load('en')
corpus = st.CorpusFromPandas(df_test,category_col='loc_k',text_col='message',nlp=nlp).build() print(list(corpus.get_scaled_f_scores_vs_background().index[:10]))
Just posted the code snippet..
Thanks
On Sat, Mar 14, 2020 at 4:10 PM Nanda Nathan vaidyan5nanda5@gmail.com wrote:
I believe that I had included the code snippet with the github post
On Sat, Mar 14, 2020 at 4:09 PM Jason S. Kessler notifications@github.com wrote:
Thanks for linking to your data. What’s needed is a code snippet that I can on the latest version of Scattertext (0.0.2.59) that reproduces this error
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JasonKessler/scattertext/issues/52#issuecomment-599129376, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJD6M7GNHQTYUUMZBX5E5BDRHPP65ANCNFSM4LHG7IWQ .
Thanks! Could you please include the line(s) which create df_test?
Here you go:
df_test.to_csv("df_test.csv", index = False)
Just posted the line Thanks
On Sat, Mar 14, 2020 at 5:21 PM Jason S. Kessler notifications@github.com wrote:
Thanks! Could you please include the line(s) which create df_test?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JasonKessler/scattertext/issues/52#issuecomment-599136260, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJD6M7FJKZ2YTR7RV4WGHPLRHPYNVANCNFSM4LHG7IWQ .
Are you sure that’s how you’re generating it?
Yes - this is how the file was generated.
Are there leading empty spaces that are causing an issue ??
Nanda
On Sat, Mar 14, 2020 at 5:48 PM Jason S. Kessler notifications@github.com wrote:
Are you sure that’s how you’re generating it?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JasonKessler/scattertext/issues/52#issuecomment-599138806, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJD6M7HJVLT2PGRRZZW2723RHP3S7ANCNFSM4LHG7IWQ .
How are you reading in the data frame from the csv file?
Or is there an issue with any string and integer casting etc.??
On Sat, Mar 14, 2020 at 5:52 PM Nanda Nathan vaidyan5nanda5@gmail.com wrote:
Yes - this is how the file was generated.
Are there leading empty spaces that are causing an issue ??
Nanda
On Sat, Mar 14, 2020 at 5:48 PM Jason S. Kessler notifications@github.com wrote:
Are you sure that’s how you’re generating it?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JasonKessler/scattertext/issues/52#issuecomment-599138806, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJD6M7HJVLT2PGRRZZW2723RHP3S7ANCNFSM4LHG7IWQ .
Using the foll: df = pd.read_csv(“file_name”)
On Sat, Mar 14, 2020 at 5:53 PM Jason S. Kessler notifications@github.com wrote:
How are you reading in the data frame from the csv file?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JasonKessler/scattertext/issues/52#issuecomment-599139492, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJD6M7BLWCIPC3AMAET4TMTRHP4DZANCNFSM4LHG7IWQ .
On Sat, Mar 14, 2020 at 5:55 PM Nanda Nathan vaidyan5nanda5@gmail.com wrote:
Using the foll: df = pd.read_csv(“file_name”)
On Sat, Mar 14, 2020 at 5:53 PM Jason S. Kessler notifications@github.com wrote:
How are you reading in the data frame from the csv file?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JasonKessler/scattertext/issues/52#issuecomment-599139492, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJD6M7BLWCIPC3AMAET4TMTRHP4DZANCNFSM4LHG7IWQ .
Frankly, I just want to make sure that when I get to my computer, I have a snippet that I can copy and paste into python and reproduce the problem.
I have limited resources to address these problems, and I really don’t want to spend time figuring out what you did to cause an error.
Sure... That’s all I did. Thanks
Nanda
On Sat, Mar 14, 2020 at 6:06 PM Jason S. Kessler notifications@github.com wrote:
Frankly, I just want to make sure that when I get to my computer, I have a snippet that I can copy and paste into python and reproduce the problem.
I have limited resources to address these problems, and I really don’t want to spend time figuring out what you did to cause an error.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JasonKessler/scattertext/issues/52#issuecomment-599140680, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJD6M7EAKV2A7YDT2DGIOLLRHP5UTANCNFSM4LHG7IWQ .
Could you run print(st.version)?
This does work for me:
>>> st.__version__
'0.0.2.59'
>>> df_test = pd.read_csv('df_test.csv')
>>> corpus = st.CorpusFromPandas(df_test,category_col='loc_k',text_col='message',nlp=nlp).build()
>>> print(list(corpus.get_scaled_f_scores_vs_background().index[:10]))
['pahahahaha', 'lexxxxxiiiiii', 'lyanna', 'lmap', 'tonighy', 'draxxxxxxxx', 'lexxx', 'bestfriend', 'sellin', 'lmao']
Hi Jason print(at.version)
Output is [0 0 2 28]
Thanks
On Sat, Mar 14, 2020 at 6:34 PM Jason S. Kessler notifications@github.com wrote:
This does work for me:
st.version '0.0.2.59' df_test = pd.read_csv('df_test.csv') corpus = st.CorpusFromPandas(df_test,category_col='loc_k',text_col='message',nlp=nlp).build() print(list(corpus.get_scaled_f_scores_vs_background().index[:10])) ['pahahahaha', 'lexxxxxiiiiii', 'lyanna', 'lmap', 'tonighy', 'draxxxxxxxx', 'lexxx', 'bestfriend', 'sellin', 'lmao']
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JasonKessler/scattertext/issues/52#issuecomment-599143231, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJD6M7A7ZWWTQ4ETU7Q3KIDRHQBAPANCNFSM4LHG7IWQ .
You need to upgrade to the latest version.
Thanks a ton for the help... Appreciate it...
Nanda.
Your Environment
df_test.csv.zip