Created
June 6, 2016 12:09
-
-
Save sundeepgupta/560af36ca0231a416bab4dd333aa0803 to your computer and use it in GitHub Desktop.
Feature extraction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function containsQuestion(message) { | |
return 1; | |
} | |
function containsYou(message) { | |
return 0; | |
} | |
function senderRelationshipType(message) { | |
return 2; | |
} | |
const Features = [ | |
containsQuestion, | |
containsYou, | |
senderRelationshipType | |
]; | |
function getFeaturesForMessage(message) { | |
var features = []; | |
for (var i = 0; i < Features.count; i++) { | |
var featureFunction = Features[i]; | |
features[i] = featureFunction(message); | |
} | |
return features; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment