Skip to content

Instantly share code, notes, and snippets.

@sundeepgupta
Created June 6, 2016 12:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sundeepgupta/560af36ca0231a416bab4dd333aa0803 to your computer and use it in GitHub Desktop.
Save sundeepgupta/560af36ca0231a416bab4dd333aa0803 to your computer and use it in GitHub Desktop.
Feature extraction
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