一分钟版本
1 | >>> python xxx.py # 直接运行 |
主要区别在于sys.path
不同
直接运行会将该脚本所在目录添加至sys.path
当做模块启动则会将当前运行命令的路径添加至sys.path
积极勤奋,主动勇敢
安装参照使用pipenv管理你的项目
在~/.bash_profile
里加上下面两行
1 | export LC_ALL=en_US.UTF-8 |
如果对于一个类,我们希望用getter和setter来控制成员变量的赋值和取值,又不希望对于每一个成员变量都显式的写出getter和setter, 就可以用@property
1 | class Student: |
When calling
1 | Student().score # get_score |
More details about the func property
here
txtaug is a command line tool written in Python3 for text augmentation based on Baidu translation API.
Student: ZHU Xingye (Joseph)
Supervisor: Prof. Francis C.M. Lau
Public perception analysis helps improve services and detect issues. This project conducts sentiment analysis and topic labelling task on Hong Kong MTR related tweets under Siemens application scene and compares algorithms adopted in each task. For sentiment analysis, we applies traditional deep neural network such as RNN, CNN on public massive sentiment dataset. For topic labelling, we crawled, labeled, augmented our own dataset and adopts latest transfer learning techniques like BERT, ULMFiT. For both tasks, we use FastText which is a light yet powerful and fast text classification algorithm as baseline.
In our experiments, RNN and ULMFiT achieved the best performance in sentiment analysis and topic labelling task respectively. Our experiments suggest that feature extraction determines model performance while most suitable feature extraction level depends on dataset(size, quality, etc) and label categories. Under extraction like CNN or over extraction like BERT might both lead to worse performance. Also, introducing transfer learning to NLP related tasks in public perception analysis is promising especially when labeled samples are limited.