Created
October 3, 2012 16:51
-
-
Save language-engineering/3828258 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| from sussex_nltk.stats import expected_sentiment_tokens, normalised_lexical_diversity, prob_short_sents | |
| #Ensure that you correctly pass either a list of tokens, or a list of sentences (see comments below) | |
| #This function requires a list of tokens acquired from the "sample_words_by_sents" function on a corpus reader | |
| print "Expected number of sentiment tokens per 500 tokens: %s" % expected_sentiment_tokens(tokens) | |
| #This function requires a list of tokens acquired from the "sample_words_by_sents" function | |
| print "Normalised lexical diversity: %s" % normalised_lexical_diversity(tokens) | |
| #This function requires a list of sentences, where each sentence is a list of tokens | |
| #which is acquired using the "sample_sents" function on a corpus reader | |
| print "Probability of short sentences: %s" % prob_short_sents(sents) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment