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
| ############################################################################ | |
| # # | |
| # Excluding participants who participated in previous studies # | |
| # By Arnoud Plantinga, based on Gabriele Paolacci's Excel solution # | |
| # # | |
| # Instructions (Note: edit only the non-indented lines): # | |
| # # | |
| # 1. Create a qualification (e.g., "Study 1"; keep in mind that the name # | |
| # will be visible to Workers) in MTurk/Manage/Qualification Types # | |
| # # |
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
| #!/usr/bin/env python | |
| # | |
| # Very basic example of using Python and IMAP to iterate over emails in a | |
| # gmail folder/label. This code is released into the public domain. | |
| # | |
| # RKI July 2013 | |
| # http://www.voidynullness.net/blog/2013/07/25/gmail-email-with-python-via-imap/ | |
| # | |
| import sys | |
| import imaplib |
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
| import math | |
| from text.blob import TextBlob as tb | |
| def tf(word, blob): | |
| return blob.words.count(word) / len(blob.words) | |
| def n_containing(word, bloblist): | |
| return sum(1 for blob in bloblist if word in blob) | |
| def idf(word, bloblist): |