Skip to main content

A library and tool for implementing TSSort in Python, which allows for the sorting of a list using pairwise comparisons while accounting for noisy data.

Project description

This repository contains an implementation of the TSSort algorithm proposed in "TSSort – Probabilistic Noise Resistant Sorting" (Hees et al., 2011).

Expected Input

This module expects a text file with a list of sentences separated by newline and a text file of a list of pairwise comparisons in the form int,int and separated by newline. See the sample data files comparisons.txt and sentences.txt in the linked github for an example. The list of pairwise comparisons refers to the sentence index (starting at 0), wherein the first number is the easier sentence and the second number is the harder sentence.

To run the code:

python3 -m tssort comparisons.txt sentences.txt [-l or -n]

where the comparisons.txt file is your list of comparisons and the sentences.txt file is you list of sentences. Note, the comparisons.txt file must reference the index ordering of sentences in the sentences.txt file.

The -l argument will output the ranked list of the sentences, from easiest to hardest.

The -n argument outputs suggestions for the sentences that should be compared next to ensure the most efficient method of sorting the list.

Project details


Download files

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

Source Distribution

tssort-0.0.2.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

tssort-0.0.2-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file tssort-0.0.2.tar.gz.

File metadata

  • Download URL: tssort-0.0.2.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for tssort-0.0.2.tar.gz
Algorithm Hash digest
SHA256 42d1bfe7afecab4d57b6b675037a24299485b9b847fe4b0baa7d3a9993637d66
MD5 5e07ad1203cfc0a545d7eb59580e2024
BLAKE2b-256 b1307ca8019d032f64c7b8819f6a5a63fb21b7c4b65176ddbe02490da9fce2b4

See more details on using hashes here.

File details

Details for the file tssort-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: tssort-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for tssort-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7143149d85484e287e1806c393ee4866994778428ce2322ed374a21eb0351fb4
MD5 5aefda50c9486c67133318a8ea0fa8a7
BLAKE2b-256 b0458da90e42e2c8ed40c36fc86a9bfe056f055ee58e9f05e232d45c2561e7c8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page