We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
I am trying to extract subject-verb-object triplets from my data and then attach an ID like this:
#Make dataframe with SVO extraction count = 0; df2 = pd.DataFrame(); for row in df1.iterrows(): doc = nlp(unicode(row)); text_ext = textacy.extract.subject_verb_object_triples(doc); tweetID = df1['id'].tolist(); mylist = list(text_ext) count = count + 1; if (mylist): df2 = df2.append(mylist, ignore_index=True) else: df2=df2.append([['0','0','0']],ignore_index=True) #Join dataframe to attach ID df2.columns = ['Subject', 'Verb', 'Object'] df3 = pd.concat([df2, df1], axis=1) print df3
However for some rows more than one SVO is being extracted which is throwing the output out of line with the ID.
Is there someway to overcome this (even if it is by dropping any SVOs more than the first one per row).
Thank you!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
I am trying to extract subject-verb-object triplets from my data and then attach an ID like this:
However for some rows more than one SVO is being extracted which is throwing the output out of line with the ID.
Is there someway to overcome this (even if it is by dropping any SVOs more than the first one per row).
Thank you!
The text was updated successfully, but these errors were encountered: