Skip to main content

Citation style classifier

Citation style classifier can automatically infer citation style from a reference string. The classifier is a Logistic Regression model trained on 90,000 reference strings. The following citation styles are supported by default:

  • acm-sig-proceedings
  • american-chemical-society
  • american-chemical-society-with-titles
  • american-institute-of-physics
  • american-sociological-association
  • apa
  • bmc-bioinformatics
  • chicago-author-date
  • elsevier-without-titles
  • elsevier-with-titles
  • harvard3
  • ieee
  • iso690-author-date-en
  • modern-language-association
  • springer-basic-author-date
  • springer-lecture-notes-in-computer-science
  • vancouver
  • unknown

The package contains the training data, the classification model, and the code for feature extraction, selection, training and prediction.

Installation

    pip3 install styleclass

Classification

From command line:

    styleclass_classify -r "reference string"
    styleclass_classify -i /file/with/reference/strings/one/per/line -o /output/file

In Python code:

    from styleclass.classify import classify
    from styleclass.train import get_default_model

    model = get_default_model()
    prediction = classify("reference string", *model)
    prediction = classify(["reference string #1", "reference string #2", "reference string #3"], *model)

Data

Styleclass package contains two datasets: training set and test set. Each of them contains a sample of 5,000 DOIs formatted in 17 citation styles (listed above), which gives 85,000 reference strings. Both datasets were generated automatically using Crossref REST API.

A new dataset can be generated using the script styleclass_generate_dataset.

Models

The default model was trained on the training dataset. Before the training, the dataset was cleaned and enriched with random noise. 5,000 strings with "unknown" style were also generated and added to the dataset.

Script styleclass_train_model can be used to train a new model. This is useful especially when you need to operate of a different set of citation styles than our default. The script prepares the data for training in the same was as was done for training of the default model.

Evaluation

styleclass_evaluate script can be used to evaluate exisitng model on a test set, in terms of accuracy.

The accuracy of the default model estimated on our test set is 95%.

Metadata

Release files for styleclass 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for styleclass 0.0.5
File Size Uploaded
styleclass-0.0.5.tar.gz 5.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for styleclass 0.0.5
File Interpreter ABI Platform
styleclass-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 11.8 MB

Release files / styleclass-0.0.5.tar.gz

Download URL styleclass-0.0.5.tar.gz
Size 5.9 MB
Tags Source
SHA-256 checksum
How to use checksums
f4674a719549a435beb98ef6b8c23c23d4ac47473aaa7cdfd68dfb18a1167d2a
BLAKE2b-256 checksum
How to use checksums
ac01009f912b04e27bfeede7f7fb3112bdfeb8f5bf18938f454d872559be31e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.9

Release files / styleclass-0.0.5-py3-none-any.whl

Download URL styleclass-0.0.5-py3-none-any.whl
Size 5.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
34cae3f586548e021a2120e8574abdd4f5ce50c365ceb8d5d2d19c964bf18907
BLAKE2b-256 checksum
How to use checksums
cbbc240ca0bbded515eeae2c9596a9a900120d4a2f02352462028f8af563b59c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.9

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page