Skip to content

Instantly share code, notes, and snippets.

@dcshapiro
Created October 8, 2017 23:39
Show Gist options
  • Save dcshapiro/4aad96aaa24d39513eb862d5ea97ed42 to your computer and use it in GitHub Desktop.
Save dcshapiro/4aad96aaa24d39513eb862d5ea97ed42 to your computer and use it in GitHub Desktop.
Extract Event Features from event
def getEventFeatures(event, map, graph):
#extract numerical fields into numpy array
#extract categorical fields
#binarize categorical fields using the categorical feature map
#extract image data into fixed size vector using CNN(s)
#extract text data into fixed-length word2vec vector (e.g. sentence vector, paragraph vector, doc2vec)
#extract relationship data from the knowledge graph
#concatenate the extracted features above into a fixed-length feature vector x
#example: x=np.concatenate((x, image_data), axis=1)
return x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment