Last active
June 27, 2019 01:03
-
-
Save jw-jenrise/d916e266984b9d712dbeabb7bc7a9914 to your computer and use it in GitHub Desktop.
AWS - Proper noun filtering
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
// AWS Comprehence | |
//http://www.jsonquerytool.com/ | |
var filteredToken = _.filter( | |
input.SyntaxTokens, | |
function(token) { | |
return token.PartOfSpeech.Tag == "PROPN" && token.PartOfSpeech.Score > 0.95; | |
}).sort(function(t1,t2){ | |
return t2.PartOfSpeech.Score - t1.PartOfSpeech.Score; | |
}).map(function(token){ | |
return { | |
"confidence" : Math.floor(token.PartOfSpeech.Score * 100,2), | |
"text": token.Text | |
} | |
}); | |
filteredToken; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment