<commit_before>Research Level Classifier
==========

Predict research level from text: http://www.sciencedirect.com/science/article/pii/S1751157713000825

Any use of this code should reference the following article:

<NAME>., <NAME>., <NAME>., <NAME>., & <NAME>. (2014). Classification of individual articles from all of science by research level. *Journal of Informetrics*, 18(1), 1-12. (DOI: 10.1016/j.joi.2013.10.005)

Word-feature weights are contained in the data/word_features.txt.gz file.
File is tab-delimited text with 3 columns: research-level, type, word, weight.
Where a type of `t` denotes a title word feature, and a type of `a` denotes an abstract word feature.

Installing
----------

It may be easiest to run this from a Python virtual environment (https://pypi.python.org/pypi/virtualenv) with python 3.

To install the Python dependencies:

    $ pip install -r requirements.txt

Running
-------

Input files should be tab-delimited text files with three columns: id, title, abstract.
A sample input file `data/sample-data.txt` is included. Our output from that input file is also
included in `data/sample-output.txt`.

You should be able to run the classifier like this:<commit_msg>Document testing procedure<commit_after>Research Level Classifier
==========

Predict research level from text: http://www.sciencedirect.com/science/article/pii/S1751157713000825

Any use of this code should reference the following article:

<NAME>., <NAME>., <NAME>., <NAME>., & <NAME>. (2014). Classification of individual articles from all of science by research level. *Journal of Informetrics*, 18(1), 1-12. (DOI: 10.1016/j.joi.2013.10.005)

Word-feature weights are contained in the data/word_features.txt.gz file.
File is tab-delimited text with 3 columns: research-level, type, word, weight.
Where a type of `t` denotes a title word feature, and a type of `a` denotes an abstract word feature.

Installing
----------

It may be easiest to run this from a Python virtual environment (https://pypi.python.org/pypi/virtualenv) with python 3.

To install the Python dependencies:

    $ pip install -r requirements.txt

Testing
-------

To test, just run the included test script:

    $ python test_rlev_model.py
    .
    ----------------------------------------------------------------------
    Ran 1 test in 0.247s

    OK

Running
-------

Input files should be tab-delimited text files with three columns: id, title, abstract.
A sample input file `data/sample-data.txt` is included. Our output from that input file is also
included in `data/sample-output.txt`.

You should be able to run the classifier like this:
{'fraction_non_alphanumeric': 0.13214013709063213, 'fraction_numerical': 0.034653465346534656, 'mean_word_length': 3.3637873754152823, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1581050', 'n_tokens_mistral': 813, 'n_tokens_neox': 725, 'n_words': 318}