[return to overview page]

In this section, we will generate our third and last hybrid human-computer model. This will be a neural network model. The general training-testing and model building procedure will be exactly the same as for our earlier neural network model, with again the exception that our hybrid model will also take into account human predictions as a feature. The performance of this model will be compared to the performance of a non-hybrid model (which uses only textual features) trained on the same statements.

As with our original neural network models, our new hybrid and non-hybrid neural network models will be: “feed-forward”, neural networks with a single hidden layer.


Again, I will start by loading relevant packages.

# before knitting: message = FALSE, warning = FALSE
library(tidyverse) # cleaning and visualization
library(caret) # modeling
library(nnet) # for neural networks specifically (caret "nnet" wraps these functions)

Load Data

Next, I will load the data file, we created earlier, which has both the cleaned and processed textual features and human predictions. Note, again, that this data file consists of a total of 3,663 statments.

# load df of combined human and processed textual feature and ground truth

# For rendering, I'm going to cheat here and load results created when this model was first run
# For some reason, chunks that were supposed to be cached when originally run are rerunning
# change the specific names (renamed at end), back to generic name
results_HYB_neural -> results

# print