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%.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

styleclass-0.0.4.tar.gz (5.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

styleclass-0.0.4-py3-none-any.whl (5.9 MB view details)

Uploaded Python 3

File details

Details for the file styleclass-0.0.4.tar.gz.

File metadata

  • Download URL: styleclass-0.0.4.tar.gz
  • Upload date:
  • Size: 5.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.6.9

File hashes

Hashes for styleclass-0.0.4.tar.gz
Algorithm Hash digest
SHA256 60c8101e8d06af6b5b8ecdbac8d0c59117940dba776af0889ad6a300ceb54510
MD5 05e1f9b92740a513f50ca352154e00ae
BLAKE2b-256 18c82a073ada4049b6dbb52e33b3b266f3ae3888f258ed0060fcf6365d1895ac

See more details on using hashes here.

File details

Details for the file styleclass-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: styleclass-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 5.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.6.9

File hashes

Hashes for styleclass-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 68900e3982abb276204165304e0c0094e260f084cdd0f5897998dac377fbda19
MD5 835f5ff1248a94aa2dbcb04388b71516
BLAKE2b-256 01fb44c871918fa79df71ff81682ee5eabe75712736340900b9954e30032d351

See more details on using hashes here.

Release history Release notifications | RSS feed

0.0.5

2 files

This release

0.0.4 This release

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 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