ProQuo


NameProQuo JSON
Version 1.1.1 PyPI version JSON
download
home_pageNone
SummaryProQuo is a tool for the detection of short quotations (<= 4 words) between two texts, a source text and a target text. The target text is the text quoting the source text. Quotations in the target text need to be clearly marked with quotations marks.
upload_time2024-04-16 08:27:44
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseApache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2023 Schlüsselstellen Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
keywords quotation detection quotation identification literal citation extraction natural language processing nlp text reuse
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Readme
This repository contains two tools, `ProQuo` and `ProQuoLM`. Both are tools for the detection of short quotations
(<= 4 words) between two texts, a source text and a target text. The target text is the text quoting the source text.
Quotations in the target text need to be marked with quotations marks. For more information, see below.

The main purpose of this tool is to use the pretrained models for the detection of short quotations. While we found both
approaches (`ProQuo` and `ProQuoLM`) to perform at the same level (for details, see our [publication](https://jcls.io/article/id/3590/)),
`ProQuoLm` is easier to use, better maintained and the **recommended approach**.

## Quotation Marks
By default, the "best", that is, most common, combination of opening and closing quotation mark in the specific text is used.
The following combinations are automatically tried:

1. " and "
2. „ and “
3. „ and "
4. “ and “
5. » and «
6. « and »
7. ‘ and ’

If this is not the desired behaviour, quotations marks can be manually defined using the command line options
`--open-quote` and `--close-quote`.

## Approaches Overview
`ProQuo` is a specialized pipeline which uses a [model for reference classification](proquo/model/reference/ReferenceModelTrainer.py)
and a [model for relation extraction](proquo/model/relation/RelationModelBertTrainer.py) between quotations and (page)
references to distinguish between relevant quotations (that is, quotations from the source text) and quotations
from other sources. In a third step, a rule-based algorithm is used to link the identified quotations to their source.

`ProQuoLM` uses a [fine-tuned BERT model](https://huggingface.co/Fredr0id/proquolm) in two ways: to distinguish between
relevant quotations and quotations from other sources and to link the quotations to their source.

## Pretrained Models and Training Data
The pretrained models and training data are made available and can be downloaded from [here](https://scm.cms.hu-berlin.de/schluesselstellen/proquodata).
For `ProQuoLm`, we also provide a model on [Hugging Face](https://huggingface.co/Fredr0id/proquolm). This is used by default.

## Installation

### From PyPi
**Note**: Both tools are part of the same PyPi package. So the following command installs both.

~~~
pip install ProQuo
~~~

### From Source
Checkout this repository and then run:

~~~
python -m pip install .
~~~

### Dependencies
Both installation methods install all dependencies except `tensorflow` which needs to be installed manually depending on
the individual needs, see [Tensorflow installation](https://www.tensorflow.org/install). The latest version that was tested is 2.14.1.

For `RelationModelLstmTrainer`, `tensorflow-text` is needed. `RelationModelLstmTrainer` should normally not be needed as
`RelationModelBertTrainer` performs better and is the default in the pipeline.

## Usage
The following sections describe how to use ProQuo on the command line.

### Quotation detection
To run `ProQuoLM` with the default model, use the following command:

~~~
proquolm compare path_to_source_text path_to_target_text --text --output-type text
~~~

<details>
<summary>All ProQuoLM command line options</summary>

~~~
usage: proquolm compare [-h] [--tokenizer TOKENIZER] [--model MODEL]
                        [--lower-case | --no-lower-case]
                        [--output-folder-path OUTPUT_FOLDER_PATH]
                        [--create-dated-subfolder | --no-create-dated-subfolder]
                        [--text | --no-text] [--output-type {json,text,csv}]
                        [--csv-sep CSV_SEP] [--open-quote OPEN_QUOTE]
                        [--close-quote CLOSE_QUOTE]
                        [--include-long-matches-in-result]
                        [--max-num-processes MAX_NUM_PROCESSES]
                        source-file-path target-path

ProQuoLm compare allows the user to find short quotations (<= 4 words) in two
texts, a source text and a target text. The target text is the text quoting
the source text. Quotations in the target text need to be clearly marked with
quotations marks.

positional arguments:
  source-file-path      Path to the source text file
  target-path           Path to the target text file or folder

options:
  -h, --help            show this help message and exit
  --tokenizer TOKENIZER
                        Name of the tokenizer to load from Hugging Face or
                        path to the tokenizer folder
  --model MODEL         Name of the model to load from Hugging Face or path to
                        the model folder
  --lower-case, --no-lower-case
                        Run model inference on lower case text (default: True)
  --output-folder-path OUTPUT_FOLDER_PATH
                        The output folder path. If this option is set the
                        output will be saved to a file created in the
                        specified folder
  --create-dated-subfolder, --no-create-dated-subfolder
                        Create a subfolder named with the current date to
                        store the results (default: False)
  --text, --no-text     Include matched text in the returned data structure
                        (default: True)
  --output-type {json,text,csv}
                        The output type
  --csv-sep CSV_SEP     output separator for csv (default: '\t')
  --open-quote OPEN_QUOTE
                        The quotation open character. If this option is not
                        set, then the type of quotation marks used in a target
                        text is auto automatically identified.
  --close-quote CLOSE_QUOTE
                        The quotation close character. If this option is not
                        set, then the type of quotation marks used in a target
                        text is auto automatically identified.
  --include-long-matches-in-result
                        Include matches longer than 4 words in the output
  --max-num-processes MAX_NUM_PROCESSES
                        Maximum number of processes to use for parallel
                        processing. This can significantly speed up the
                        process.
~~~

</details>

To run `ProQuo`, use the following command:

~~~
proquo compare path_to_source_text path_to_target_text
path_to_the_reference_vocab_file
path_to_the_reference_model_file
path_to_the_relation_tokenizer_folder
path_to_the_relation_model_folder
--text
--output-type text
~~~

`--output-type text` prints the results to the command line. To save the results to a file, use `--output-type csv` or
`--output-type json`. `--text` includes the quotation text in the output.

The output will look something like this:

~~~
10      15	    500	505	quote	quote
1000	1016	20	36	some other quote	some other quote
~~~

The first two numbers are the character start and end positions in the source text and the other two numbers are the
character start and end positions in the target text.

<details>
<summary>All ProQuo command line options</summary>

~~~
usage: proquo compare [-h] [--quid-match-path QUID_MATCH_PATH]
                      [--output-folder-path OUTPUT_FOLDER_PATH]
                      [--create-dated-subfolder] [--no-create-dated-subfolder]
                      [--parallel-print-files [PARALLEL_PRINT_FILES ...]]
                      [--parallel-print-first-page PARALLEL_PRINT_FIRST_PAGE]
                      [--parallel-print-last-page PARALLEL_PRINT_LAST_PAGE]
                      [--text] [--no-text] [--ref] [--no-ref]
                      [--output-type {json,text,csv}] [--csv-sep CSV_SEP]
                      [--open-quote OPEN_QUOTE] [--close-quote CLOSE_QUOTE]
                      [--include-long-matches-in-result]
                      [--max-num-processes MAX_NUM_PROCESSES]
                      source-file-path target-path ref-vocab-file-path
                      ref-model-file-path rel-tokenizer-folder-path
                      rel-model-folder-path

ProQuo compare allows the user to find short quotations (<= 4 words) in two
texts, a source text and a target text. The target text is the text quoting
the source text. Quotations in the target text need to be clearly marked with
quotations marks.

positional arguments:
  source-file-path      Path to the source text file
  target-path           Path to the target text file or folder
  ref-vocab-file-path   Path to the reference vocab text file
  ref-model-file-path   Path to the reference model file
  rel-tokenizer-folder-path
                        Path to the relation tokenizer folder
  rel-model-folder-path
                        Path to the relation model folder

options:
  -h, --help            show this help message and exit
  --quid-match-path QUID_MATCH_PATH
                        Path to the file or folder with quid matches. If this
                        option is not set, then Quid is used to find long
                        matches.
  --output-folder-path OUTPUT_FOLDER_PATH
                        The output folder path. If this option is set the
                        output will be saved to a file created in the
                        specified folder
  --create-dated-subfolder
                        Create a subfolder named with the current date to
                        store the results
  --no-create-dated-subfolder
                        Do not create a subfolder named with the current date
                        to store the results
  --parallel-print-files [PARALLEL_PRINT_FILES ...]
                        Filenames of files which quote a parallel print
                        edition
  --parallel-print-first-page PARALLEL_PRINT_FIRST_PAGE
                        Number of the first page with parallel print
  --parallel-print-last-page PARALLEL_PRINT_LAST_PAGE
                        Number of the last page with parallel print
  --text                Include matched text in the returned data structure
  --no-text             Do not include matched text in the returned data
                        structure
  --ref                 Include matched reference in the returned data
                        structure
  --no-ref              Do not include matched reference in the returned data
                        structure
  --output-type {json,text,csv}
                        The output type
  --csv-sep CSV_SEP     output separator for csv (default: '\t')
  --open-quote OPEN_QUOTE
                        The quotation open character. If this option is not
                        set, then the type of quotation marks used in a target
                        text is auto automatically identified.
  --close-quote CLOSE_QUOTE
                        The quotation close character. If this option is not
                        set, then the type of quotation marks used in a target
                        text is auto automatically identified.
  --include-long-matches-in-result
                        Include matches longer than 4 words in the output
  --max-num-processes MAX_NUM_PROCESSES
                        Maximum number of processes to use for parallel
                        processing.This can significantly speed up the
                        process.
~~~

</details>

## Parallel processing
`ProQuo` and `ProQuoLM` use [Quid](https://scm.cms.hu-berlin.de/schluesselstellen/quid) in the background which supports
using multiple processes when comparing multiple target texts with the source texts. To use Quid with multiple processes
the command line option `--max-num-processes` is used. The default is 1.

## Training
The library also supports training and testing of custom models. The [Training Readme](Training-Readme.md) gives an introduction to
training models.

## Citation
If you use `ProQuo` or `ProQuoLM` or base your work on our code, please cite our paper:
~~~
@article{arnold2023,
  author = {Frederik Arnold, Robert Jäschke},
  title = {A Novel Approach for Identification and Linking of Short Quotations in Scholarly Texts and Literary Works},
  volume = {2},
  year = {2023},
  url = {https://jcls.io/article/id/3590/},
  issue = {1},
  doi = {10.48694/jcls.3590},
  month = {1},
  publisher={Universitäts- und Landesbibliothek Darmstadt},
  journal = {Journal of Computational Literary Studies}
}
~~~

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "ProQuo",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "quotation detection, quotation identification, literal citation extraction, natural language processing, nlp, text reuse",
    "author": null,
    "author_email": "Frederik Arnold <frederik.arnold@hu-berlin.de>",
    "download_url": "https://files.pythonhosted.org/packages/84/74/34447ae85ba199b9e026968153e40648bda33d3623902201ad40dc75c04d/proquo-1.1.1.tar.gz",
    "platform": null,
    "description": "# Readme\nThis repository contains two tools, `ProQuo` and `ProQuoLM`. Both are tools for the detection of short quotations\n(<= 4 words) between two texts, a source text and a target text. The target text is the text quoting the source text.\nQuotations in the target text need to be marked with quotations marks. For more information, see below.\n\nThe main purpose of this tool is to use the pretrained models for the detection of short quotations. While we found both\napproaches (`ProQuo` and `ProQuoLM`) to perform at the same level (for details, see our [publication](https://jcls.io/article/id/3590/)),\n`ProQuoLm` is easier to use, better maintained and the **recommended approach**.\n\n## Quotation Marks\nBy default, the \"best\", that is, most common, combination of opening and closing quotation mark in the specific text is used.\nThe following combinations are automatically tried:\n\n1. \" and \"\n2. \u201e and \u201c\n3. \u201e and \"\n4. \u201c and \u201c\n5. \u00bb and \u00ab\n6. \u00ab and \u00bb\n7. \u2018 and \u2019\n\nIf this is not the desired behaviour, quotations marks can be manually defined using the command line options\n`--open-quote` and `--close-quote`.\n\n## Approaches Overview\n`ProQuo` is a specialized pipeline which uses a [model for reference classification](proquo/model/reference/ReferenceModelTrainer.py)\nand a [model for relation extraction](proquo/model/relation/RelationModelBertTrainer.py) between quotations and (page)\nreferences to distinguish between relevant quotations (that is, quotations from the source text) and quotations\nfrom other sources. In a third step, a rule-based algorithm is used to link the identified quotations to their source.\n\n`ProQuoLM` uses a [fine-tuned BERT model](https://huggingface.co/Fredr0id/proquolm) in two ways: to distinguish between\nrelevant quotations and quotations from other sources and to link the quotations to their source.\n\n## Pretrained Models and Training Data\nThe pretrained models and training data are made available and can be downloaded from [here](https://scm.cms.hu-berlin.de/schluesselstellen/proquodata).\nFor `ProQuoLm`, we also provide a model on [Hugging Face](https://huggingface.co/Fredr0id/proquolm). This is used by default.\n\n## Installation\n\n### From PyPi\n**Note**: Both tools are part of the same PyPi package. So the following command installs both.\n\n~~~\npip install ProQuo\n~~~\n\n### From Source\nCheckout this repository and then run:\n\n~~~\npython -m pip install .\n~~~\n\n### Dependencies\nBoth installation methods install all dependencies except `tensorflow` which needs to be installed manually depending on\nthe individual needs, see [Tensorflow installation](https://www.tensorflow.org/install). The latest version that was tested is 2.14.1.\n\nFor `RelationModelLstmTrainer`, `tensorflow-text` is needed. `RelationModelLstmTrainer` should normally not be needed as\n`RelationModelBertTrainer` performs better and is the default in the pipeline.\n\n## Usage\nThe following sections describe how to use ProQuo on the command line.\n\n### Quotation detection\nTo run `ProQuoLM` with the default model, use the following command:\n\n~~~\nproquolm compare path_to_source_text path_to_target_text --text --output-type text\n~~~\n\n<details>\n<summary>All ProQuoLM command line options</summary>\n\n~~~\nusage: proquolm compare [-h] [--tokenizer TOKENIZER] [--model MODEL]\n                        [--lower-case | --no-lower-case]\n                        [--output-folder-path OUTPUT_FOLDER_PATH]\n                        [--create-dated-subfolder | --no-create-dated-subfolder]\n                        [--text | --no-text] [--output-type {json,text,csv}]\n                        [--csv-sep CSV_SEP] [--open-quote OPEN_QUOTE]\n                        [--close-quote CLOSE_QUOTE]\n                        [--include-long-matches-in-result]\n                        [--max-num-processes MAX_NUM_PROCESSES]\n                        source-file-path target-path\n\nProQuoLm compare allows the user to find short quotations (<= 4 words) in two\ntexts, a source text and a target text. The target text is the text quoting\nthe source text. Quotations in the target text need to be clearly marked with\nquotations marks.\n\npositional arguments:\n  source-file-path      Path to the source text file\n  target-path           Path to the target text file or folder\n\noptions:\n  -h, --help            show this help message and exit\n  --tokenizer TOKENIZER\n                        Name of the tokenizer to load from Hugging Face or\n                        path to the tokenizer folder\n  --model MODEL         Name of the model to load from Hugging Face or path to\n                        the model folder\n  --lower-case, --no-lower-case\n                        Run model inference on lower case text (default: True)\n  --output-folder-path OUTPUT_FOLDER_PATH\n                        The output folder path. If this option is set the\n                        output will be saved to a file created in the\n                        specified folder\n  --create-dated-subfolder, --no-create-dated-subfolder\n                        Create a subfolder named with the current date to\n                        store the results (default: False)\n  --text, --no-text     Include matched text in the returned data structure\n                        (default: True)\n  --output-type {json,text,csv}\n                        The output type\n  --csv-sep CSV_SEP     output separator for csv (default: '\\t')\n  --open-quote OPEN_QUOTE\n                        The quotation open character. If this option is not\n                        set, then the type of quotation marks used in a target\n                        text is auto automatically identified.\n  --close-quote CLOSE_QUOTE\n                        The quotation close character. If this option is not\n                        set, then the type of quotation marks used in a target\n                        text is auto automatically identified.\n  --include-long-matches-in-result\n                        Include matches longer than 4 words in the output\n  --max-num-processes MAX_NUM_PROCESSES\n                        Maximum number of processes to use for parallel\n                        processing. This can significantly speed up the\n                        process.\n~~~\n\n</details>\n\nTo run `ProQuo`, use the following command:\n\n~~~\nproquo compare path_to_source_text path_to_target_text\npath_to_the_reference_vocab_file\npath_to_the_reference_model_file\npath_to_the_relation_tokenizer_folder\npath_to_the_relation_model_folder\n--text\n--output-type text\n~~~\n\n`--output-type text` prints the results to the command line. To save the results to a file, use `--output-type csv` or\n`--output-type json`. `--text` includes the quotation text in the output.\n\nThe output will look something like this:\n\n~~~\n10      15\t    500\t505\tquote\tquote\n1000\t1016\t20\t36\tsome other quote\tsome other quote\n~~~\n\nThe first two numbers are the character start and end positions in the source text and the other two numbers are the\ncharacter start and end positions in the target text.\n\n<details>\n<summary>All ProQuo command line options</summary>\n\n~~~\nusage: proquo compare [-h] [--quid-match-path QUID_MATCH_PATH]\n                      [--output-folder-path OUTPUT_FOLDER_PATH]\n                      [--create-dated-subfolder] [--no-create-dated-subfolder]\n                      [--parallel-print-files [PARALLEL_PRINT_FILES ...]]\n                      [--parallel-print-first-page PARALLEL_PRINT_FIRST_PAGE]\n                      [--parallel-print-last-page PARALLEL_PRINT_LAST_PAGE]\n                      [--text] [--no-text] [--ref] [--no-ref]\n                      [--output-type {json,text,csv}] [--csv-sep CSV_SEP]\n                      [--open-quote OPEN_QUOTE] [--close-quote CLOSE_QUOTE]\n                      [--include-long-matches-in-result]\n                      [--max-num-processes MAX_NUM_PROCESSES]\n                      source-file-path target-path ref-vocab-file-path\n                      ref-model-file-path rel-tokenizer-folder-path\n                      rel-model-folder-path\n\nProQuo compare allows the user to find short quotations (<= 4 words) in two\ntexts, a source text and a target text. The target text is the text quoting\nthe source text. Quotations in the target text need to be clearly marked with\nquotations marks.\n\npositional arguments:\n  source-file-path      Path to the source text file\n  target-path           Path to the target text file or folder\n  ref-vocab-file-path   Path to the reference vocab text file\n  ref-model-file-path   Path to the reference model file\n  rel-tokenizer-folder-path\n                        Path to the relation tokenizer folder\n  rel-model-folder-path\n                        Path to the relation model folder\n\noptions:\n  -h, --help            show this help message and exit\n  --quid-match-path QUID_MATCH_PATH\n                        Path to the file or folder with quid matches. If this\n                        option is not set, then Quid is used to find long\n                        matches.\n  --output-folder-path OUTPUT_FOLDER_PATH\n                        The output folder path. If this option is set the\n                        output will be saved to a file created in the\n                        specified folder\n  --create-dated-subfolder\n                        Create a subfolder named with the current date to\n                        store the results\n  --no-create-dated-subfolder\n                        Do not create a subfolder named with the current date\n                        to store the results\n  --parallel-print-files [PARALLEL_PRINT_FILES ...]\n                        Filenames of files which quote a parallel print\n                        edition\n  --parallel-print-first-page PARALLEL_PRINT_FIRST_PAGE\n                        Number of the first page with parallel print\n  --parallel-print-last-page PARALLEL_PRINT_LAST_PAGE\n                        Number of the last page with parallel print\n  --text                Include matched text in the returned data structure\n  --no-text             Do not include matched text in the returned data\n                        structure\n  --ref                 Include matched reference in the returned data\n                        structure\n  --no-ref              Do not include matched reference in the returned data\n                        structure\n  --output-type {json,text,csv}\n                        The output type\n  --csv-sep CSV_SEP     output separator for csv (default: '\\t')\n  --open-quote OPEN_QUOTE\n                        The quotation open character. If this option is not\n                        set, then the type of quotation marks used in a target\n                        text is auto automatically identified.\n  --close-quote CLOSE_QUOTE\n                        The quotation close character. If this option is not\n                        set, then the type of quotation marks used in a target\n                        text is auto automatically identified.\n  --include-long-matches-in-result\n                        Include matches longer than 4 words in the output\n  --max-num-processes MAX_NUM_PROCESSES\n                        Maximum number of processes to use for parallel\n                        processing.This can significantly speed up the\n                        process.\n~~~\n\n</details>\n\n## Parallel processing\n`ProQuo` and `ProQuoLM` use [Quid](https://scm.cms.hu-berlin.de/schluesselstellen/quid) in the background which supports\nusing multiple processes when comparing multiple target texts with the source texts. To use Quid with multiple processes\nthe command line option `--max-num-processes` is used. The default is 1.\n\n## Training\nThe library also supports training and testing of custom models. The [Training Readme](Training-Readme.md) gives an introduction to\ntraining models.\n\n## Citation\nIf you use `ProQuo` or `ProQuoLM` or base your work on our code, please cite our paper:\n~~~\n@article{arnold2023,\n  author = {Frederik Arnold, Robert J\u00e4schke},\n  title = {A Novel Approach for Identification and Linking of Short Quotations in Scholarly Texts and Literary Works},\n  volume = {2},\n  year = {2023},\n  url = {https://jcls.io/article/id/3590/},\n  issue = {1},\n  doi = {10.48694/jcls.3590},\n  month = {1},\n  publisher={Universit\u00e4ts- und Landesbibliothek Darmstadt},\n  journal = {Journal of Computational Literary Studies}\n}\n~~~\n",
    "bugtrack_url": null,
    "license": "Apache License Version 2.0, January 2004 http://www.apache.org/licenses/  TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION  1. Definitions.  \"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.  \"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.  \"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.  \"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.  \"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.  \"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.  \"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).  \"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.  \"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"  \"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.  2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.  3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.  4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:  (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and  (b) You must cause any modified files to carry prominent notices stating that You changed the files; and  (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and  (d) If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.  You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.  5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.  6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.  7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.  8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.  9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.  END OF TERMS AND CONDITIONS  APPENDIX: How to apply the Apache License to your work.  To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \"[]\" replaced with your own identifying information. (Don't include the brackets!)  The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \"printed page\" as the copyright notice for easier identification within third-party archives.  Copyright 2023 Schl\u00fcsselstellen  Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at  http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ",
    "summary": "ProQuo is a tool for the detection of short quotations (<= 4 words) between two texts, a source text and a target text. The target text is the text quoting the source text. Quotations in the target text need to be clearly marked with quotations marks.",
    "version": "1.1.1",
    "project_urls": {
        "Homepage": "https://hu.berlin/proquo"
    },
    "split_keywords": [
        "quotation detection",
        " quotation identification",
        " literal citation extraction",
        " natural language processing",
        " nlp",
        " text reuse"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "51990d1ace578cf2cc05a02c79ffc3f10cc2e4e097738d0a568c97e4a1eeb505",
                "md5": "8274cc743845b1e2158bf986c6195cc9",
                "sha256": "de056a13229f0f02c18ccecfe8d1914c401760c199ff53150f39acf61689bb56"
            },
            "downloads": -1,
            "filename": "ProQuo-1.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8274cc743845b1e2158bf986c6195cc9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 55619,
            "upload_time": "2024-04-16T08:27:42",
            "upload_time_iso_8601": "2024-04-16T08:27:42.555253Z",
            "url": "https://files.pythonhosted.org/packages/51/99/0d1ace578cf2cc05a02c79ffc3f10cc2e4e097738d0a568c97e4a1eeb505/ProQuo-1.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "847434447ae85ba199b9e026968153e40648bda33d3623902201ad40dc75c04d",
                "md5": "9bf6ee1509dffc3a3726ccf3137603cc",
                "sha256": "f5c7eb98a5e4bea72e09689b1436ef1d08acc07492cb3030f5a6bdfa29dabf19"
            },
            "downloads": -1,
            "filename": "proquo-1.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "9bf6ee1509dffc3a3726ccf3137603cc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 37134,
            "upload_time": "2024-04-16T08:27:44",
            "upload_time_iso_8601": "2024-04-16T08:27:44.621289Z",
            "url": "https://files.pythonhosted.org/packages/84/74/34447ae85ba199b9e026968153e40648bda33d3623902201ad40dc75c04d/proquo-1.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-16 08:27:44",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "proquo"
}
        
Elapsed time: 1.14933s