基于文本的twitter性别预测。
speks的Python项目详细描述
一个封装的版本,适应于python 3,TwitterGenderPredictor code by JT Wolohan,它本身是sap等人的twitter性别预测算法的python 2实现。SPEKS代表SAP,Park,Eichstaedt,克恩和史迪威,这是前面实现的{A7}的前五位作者。
>>>fromspeksimportpredict_gender_by_tweets>>>gender=predict_gender_by_tweets(" ".join(["Please Do.","Join me in praying!"]))
内容
1 Features
- 支持Python3。
- pip-可安装。
- 全面测试。
2 Installation
pip install speks
3 Use
这是python 3的打包版TwitterGenderPredictor code by JT Wolohan,它本身是sap等人的twitter性别预测算法的python 2实现。该算法应该是90%的准确率给定一个大样本用户和一个合理的数据量为每个用户。
通过为predict_gender_by_tweets函数提供包含tweets内容的字符串,可以让包预测twitter用户的性别。
>>>fromspeksimportpredict_gender_by_tweets>>>gender=predict_gender_by_tweets(" ".join(["No touchy","Trial by fire"]))
4 Licensing
大部分代码是由JT Wolohan在MPL 2.0 license下发布的,因此我将在同一个许可证下发布我的添加内容。然而,标记化代码(尽管稍有改动)最初是由Christopher Potts编写的,并在CC BY-NC-SA 3.0 license下发布,因此仍在本许可下发布。
5 Contributing
当前的软件包维护者和作者是shay palachy(shay.palachy@gmail.com);非常欢迎您向他寻求帮助。捐款是非常受欢迎的。
5.1 Installing for development
克隆:
git clone git@github.com:shaypal5/speks.git
以开发模式安装,包括测试依赖项:
cd speks pip install -e '.[test]'
5.3 Adding documentation
该项目是使用numpy docstring conventions来记录的,之所以选择它们,是因为它们可能是最广泛传播的约定,它们都得到了sphinx等常用工具的支持,并产生了人类可读的docstring。在记录添加到此项目中的代码时,请遵循these conventions。
此外,如果您更新了这个README.rst文件,请使用python setup.py checkdocs验证它的编译。
6 Credits
算法由Sap et al。原始代码由JT Wolohan,标记化代码由Christopher Potts。通过Shay Palachy打包和python 3改编。
原稿参考: SAP,M.,Park,G.,Eichstaedt,J.,Kern,M.,Stillwell,D.,Kosinski,M.,…&Schwartz,H.A.(2014年)。社会媒体发展年龄和性别预测词汇。《2014年自然语言处理经验方法会议记录》(第1146-1151页)。