semvec/pypi-packages huggingface dataset:
xmi2conll 0.1.6
Simple CLI to convert any annotated document in UIMA CAS XMI to CONLL format (IOB schema support).
License: MIT
Requires Python: >=3.7

# xmi2conll CLI

![Python Version](https://img.shields.io/badge/Python-%3E%3D%203.7-%2313aab7) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![PyPI version](https://badge.fury.io/py/xmi2conll.svg)](https://badge.fury.io/py/xmi2conll)

![logo](./docs/x2c_logo.png)

Simple CLI to convert any annotated document in UIMA CAS XMI to CONLL format (IOB schema support).

### Installation:

Start by create and activate a new environnement with virtualenv : 

```bash
virtualenv --python=/usr/bin/python3.8 venv
source venv/bin/activate
```

then choose:

- Easy way (use pip):

```bash
pip install xmi2conll
```

- Dev install:

```bash
git clone https://github.com/Lucaterre/xmi2conll
pip install -r requirements.txt
```


### Usage:

with pip install run:
```bash
x2c --help
```

or with dev install run:
```bash
python x2c.py --help
```

```
Usage: x2c.py [OPTIONS] INPUT_XMI TYPESYSTEM

  XMI to CONLL Converter CLI © 2022 - @Lucaterre

  INPUT_XMI (str): XMI file path or directory path that contains XMI for batch
  processing.

  TYPESYSTEM (str): Typesystem.xml path.

Options:
  -o, --output TEXT               output path that contains new conll, 
                                  if it not specify ./output/ is auto created.
                                  [default: ./output/]
  -tn, --type_name_annotations TEXT
                                  type name of the annotations  [default: de.t
                                  udarmstadt.ukp.dkpro.core.api.ner.type.Named
                                  Entity]
  -s, --conll_separator TEXT      Defines a separator in CONLL between mention
                                  and label; only 'space' or 'tab' are accepted [default:
                                  space]
  -h, --header BOOLEAN            show or hide title of CLI  [default: True]
  --help                          Show this message and exit.

```

### Citation:

```
@misc{xmi2conll-cli,
    author = "Lucas Terriel",
    title = {xmi2conll, a cli to convert any annotated document in UIMA CAS XMI to CONLL format (IOB schema support)},
    howpublished = {\url{https://github.com/Lucaterre/xmi2conll}},
    year = {2022}
}
```

### License:

This tool is distributed under MIT license.
python-3pl-central 0.1.1
3PL REST API Client
License: MIT

TPL Python API
==============

A Python wrapper for the 3PL Central REST API

Usage
-----

set up a `.env` file in the root of the project:

.. code-block:: python

    BASE_URL="https://secure-wms.com" 
    AUTH_PATH="AuthServer/api/Token"
    CLIENT_ID="your-id"
    CLIENT_SECRET="your-secret"
    FACILITY_ID=99
    TPL_KEY="your-tpl-key"
    GRANT_TYPE="client_credentials"
    USER_LOGIN_ID="name-this-whatever-you-want"
    ROUTING_INFO_ACCOUNT_NUMBER="ups-account-number"

Verify that you can access the api by running 

.. code-block:: python
    
    python3 -m verify_credentials



Then, run the following get a list of methods you can try out, with a handy run-in-place CLI:


.. code-block:: shell
    
    python3 -m examples


.. code-block::

    Which endpoint do you want to try?
    1) cancel_test_order

    2) create_test_item

    3) create_test_order

    4) get_carriers_list

    5) get_order

    Enter a number:



License
-------

MIT

See LICENSE for more details
second-opinion-ruler 0.1.0
A spaCy custom component that extends the SpanRuler with a second opinion
License: MIT
Requires Python: >=3.10,<4.0
Keywords: python,spaCy,custom component

# Second Opinion Ruler

`second_opinion_ruler` is a [spaCy](https://spacy.io/) component that extends [`SpanRuler`](https://spacy.io/usage/rule-based-matching#spanruler) with a second opinion. For _each_ pattern you can provide a callback (available in [`registry.misc`](https://spacy.io/api/top-level/#registry)) on the matched [`Span`](https://spacy.io/api/span/#_title) - with this you can decide to discard the match, add additional spans to the match and/or mutate the matched span, e.g. add a parsed `datetime` to a custom attribute.

## Installation

```
pip install second_opinion_ruler
```

## Usage

```python
import spacy
from spacy.tokens import Span
from spacy.util import registry

# create date as custom attribute extension
Span.set_extension("date", default=None)

# add datetime parser to registry.misc
# IMPORTANT: first argument has to be Span and the return type has to be list[Span]
@registry.misc("to_datetime.v1")
def to_datetime(span: Span, format: str, attr: str = "date") -> list[Span]:

    # parse the date
    date = datetime.datetime.strptime(span.text, format)

    # add the parsed date to the custom attribute
    span._.set(attr, date)

    # just return matched span
    return [span]

# load a model
nlp = spacy.blank("en")

# add the second opinion ruler
ruler = nlp.add_pipe("second_opinion_ruler", config={
    "validate": True,
    "annotate_ents": True,
})

# add a pattern with a second opinion handler (on_match)
ruler.add_patterns([
    {
        "label": "DATE",
        "pattern": "21.04.1986",
        "on_match": {
            "id": "to_datetime.v1",
            "kwargs": {"format": "%d.%m.%Y", "attr": "my_date"},
        },
    }
])

doc = nlp("This date 21.04.1986 will be a DATE entity while the structured information will be extracted to `Span._.extructure`")

# verify
assert doc.ents[0]._.date == datetime.datetime(1986, 4, 21)
```