Version 16 (modified by Jan Rygl, 6 years ago) (diff)



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


  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 server:
  2. Download a python package
  3. Unzip a downloaded file
    unzip; unzip
  4. Go to an unziped folder
    cd sir-assignment
  5. Test a program

or on nymfe edit

#!/usr/bin/env bash
export RFTagger='/home/xrygl/RFTagger'
export PYTHON_INTERPRETER='/home/xrygl/python/bin/python'
export TEST_DATA_PATH='/home/xrygl/test_data/seznamky'
export TUNE_DATA_PATH='/home/xrygl/test_data/stesti'

$PYTHON_INTERPRETER -m http_server.basic_task -p TEST -c $TEST_DATA_PATH -e $TUNE_DATA_PATH 2>/dev/null

and then


Faster way:

wget; unzip; unzip; cd sir-assignment


Examine files in a stylometry_features folder. Modify an 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 ./ again. The first call of 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 (