wiki:private/AdvancedNlpCourse/Stylometry

Version 18 (modified by Ales Horak, 6 years ago) (diff)

--

Stylometry

IA161 Advanced NLP Course, Course Guarantee: Aleš Horák

Prepared by: Honza Rygl

State of the Art

The analysis of author's characteristic writing style and vocabulary has been used to uncover author's traits such as authorship, age, or gender documents by both manual linguistic approaches and automatic algorithmic methods.

The most common approach to stylometry problems is to combine stylistic analysis with machine learning techniques:

  1. specific style markers are extracted,
  2. a classification procedure is applied to extracted markers

References

  1. Stamatatos, E. (2009), A Survey of Modern Authorship Attribution Methods (2009), Journal of the American Society for Information Science and Technology, 60(3), 538-556. pdf
  2. Kestemont, M. (2014), Function Words in Authorship Attribution From Black Magic to Theory? Proceedings of the 3rd Workshop on Computational Linguistics for Literature, EACL 2014, 59–66 pdf
  3. Walter, D. Explanation in Computational Stylometry

Practical Session

Student will get to know a *Style & Identity Recognition* tool. They will test this tool on prepared data. Their goal will be to implement a small function to extract style markers from a text.

  1. go to asteria04.fi.muni.cz server:
    ssh asteria04.fi.muni.cz
    
  2. Download a python package with the assignment
  3. Unzip the downloaded file
    unzip stylometry-assignment.zip
    
  4. Go to the unziped folder
    cd sir-assignment
    
  5. Test the prepared program that analyses data from on-line dating services to distinguish gender (masculine/feminine) by text style features
    ./run.sh
    

Task

Examine files in a stylometry_features folder. Modify an assignment.py file to increase an accuracy of methods. You can create another classes inside, change their names and class names to improve the accuracy score. Don't forget to add new classes into an assignments list in this file.

Each modification can be tested by running ./run.sh again. The first call of run.sh can be slower, because documents are morphologically analysed during the first run.

Submit your assignment file. Write nice Python code and don't forget about PEP8 (https://www.python.org/dev/peps/pep-0008/).