knitr::opts_chunk$set(echo = TRUE)
The purpose of this notebook is to compare the extracted entities generated by the keras model with the entites generated by regex splitting.
if (!require(pacman)) {install.packages('pacman')} p_load( dplyr )
The input text will be our training data hypotheses.
df_raw <- read.csv("entity_extraction_comparison.csv", stringsAsFactors = FALSE) # df_raw$sentence
df_raw %>% glimpse()
df <- df_raw %>% rename( hypothesis_training = hypothesis, hypothesis = hypothesis_pr ) df %>% glimpse() nodes <- entity_extraction(df) nodes
output <- cbind(df, nodes) %>% rename(node1_model = cause, node2_model = effect) %>% select(file_name:node2, node1_split:node2_model) %>% rename(hypothesis = hypothesis_training) output %>% glimpse()
write.csv(output, "training_data_w_extracted_entities.csv")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.