Skip to content

Instantly share code, notes, and snippets.

@samk3211
Last active December 13, 2023 19:49
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save samk3211/1d233b29ce5acc93f4a3e8c13db8ccd3 to your computer and use it in GitHub Desktop.
Save samk3211/1d233b29ce5acc93f4a3e8c13db8ccd3 to your computer and use it in GitHub Desktop.
This gist is part of my blogpost on BERT. Find the complete blogpost, covering both theory and hands-on part, here: https://towardsml.com/2019/09/17/bert-explained-a-complete-guide-with-theory-and-tutorial/
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@TaylorHawkes
Copy link

For some reason when saving that alpha (a) saves as first column and was messing up the training.
I changed that "alpha" column to "poop" and it fixed it. (think it is just saving columns alphabetically, maybe there is better fix here haha)

df_bert = pd.DataFrame({
'id':range(len(train_df)),
'label':train_df[0],
'poop':['a']*train_df.shape[0],
'text': train_df[1].replace(r'\n', ' ', regex=True)
})

@Gaurav-AL
Copy link

Hey sir, can you tell me, how can I map words, only nouns, and adjectives to particular classes and properties of the Graph database, DO I have to create a dataset for each word and their respective classes and properties in an Ontology?

I am working on Q&A System for the graph database basically , I found research paper that do these thing but I don't think of how to achieve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment