semvec/pypi-packages huggingface dataset:
extr 0.0.44
Named Entity Recognition (NER) and Relation Extraction (RE) library using Regular Expressions
Keywords: Named Entity Recognition,Relation Extraction,Entity Linking,NER,RE,NLP

# Extr
> Named Entity Recognition (NER) and Relation Extraction (RE) library using Regular Expressions

<br />

## Install

```
pip install extr
```

## Example

```python
text = 'Ted is a Pitcher.'
```

### 1. Entity Extraction
> Find Named Entities from text.

```python
from extr import RegEx, RegExLabel
from extr.entities import EntityExtractor

entity_extractor = EntityExtractor([
    RegExLabel('PERSON', [
        RegEx([r'ted'], re.IGNORECASE)
    ]),
    RegExLabel('POSITION', [
        RegEx([r'pitcher'], re.IGNORECASE)
    ]),
])

entities = entity_extractor.get_entities(text)

## entities == [
##      <Entity label="POSITION" text="Pitcher" span=(9, 16)>,
##      <Entity label="PERSON" text="Ted" span=(0, 3)>
## ]
```

**<i> or add a knowledge base</i>**

```python
from extr import RegEx, RegExLabel
from extr.entities import create_entity_extractor

entity_extractor = create_entity_extractor(
    [
        RegExLabel('POSITION', [
            RegEx([r'pitcher'], re.IGNORECASE)
        ]),
    ],
    kb={
        'PERSON': ['Ted']
    }
)

entities = entity_extractor.get_entities(text)

## entities == [
##      <Entity label="POSITION" text="Pitcher" span=(9, 16)>,
##      <Entity label="PERSON" text="Ted" span=(0, 3)>
## ]
```

### 2. Visualize Entities in HTML
> Annotate text to display in HTML.

```python
from extr.entities.viewers import HtmlViewer

viewer = HtmlViewer()
viewer.append(text, entities)

html = viewer.create_view(custom_styles="""
    .lb-PERSON {
        background-color: orange;
    }

    .lb-POSITION {
        background-color: yellow;
    }
""")
```

![](https://github.com/dpasse/extr/blob/main/docs/images/annotations.JPG)

### 3. Relation Extraction
> Annotate and Extract Relationships between Entities

```python
from extr.entities import EntityAnnotator
from extr.relations import RelationExtractor, \
                           RegExRelationLabelBuilder

## define relationship between PERSON and POSITION
relationship = RegExRelationLabelBuilder('is_a') \
    .add_e1_to_e2(
        'PERSON', ## e1
        [
            ## define how the relationship exists in nature
            r'\s+is\s+a\s+',
        ],
        'POSITION' ## e2
    ) \
    .build()

relations_to_extract = [relationship]

## `entities` see 'Entity Extraction' above
annotated_text = EntityAnnotator().annotate(text, entities)
relations = RelationExtractor(relations_to_extract).extract(annotated_text, entities)

## relations == [
##      <Relation e1="Ted" r="is_a" e2="Pitcher">
## ]

```
sublimepy 0.0.3
Tools for working with data from the Sublimation of Snow project.
Requires Python: >=3.11

# sublimepy
Tools for working with data from the Sublimation of Snow project.

Check out test.ipynb to see some functionality. 

Contains the following modules:
sublimepy.utils
* Utilities for downloading, cleaning, and otherwise working with SoS data.

sublimepy.variables
* Convenience functions for calculating additional variables from SoS measurements.
* E.g. surface temperatures, virtual potential temperatures, turbulent kinetic energy

sublimepy.tidy
* Convenience functions for creating a tidy dataframe dataset from SoS NetCDF datasets.
* Tidy dataframes have "height", "tower", and "measurement" columns which are parsed from the variables provided in the original SoS datasets.

sublimepy.gradients
* Classes to calculate wind and temperature gradients and Richardson numbers from SoS measurements.
* Multiple methods are available, including fitting log-linear and log-polynomial curves, and simple central-differencing.

This package is published exclusively to pip. It can be installed 
```
pip install sublimepy
```

It is published to pypi like so:
```
python setup.py sdist bdist_wheel
python -m twine upload dist/*
```
cerc-geometry 2.1.3
CERC Geometry Library with different modules to manipulate geometric objects
Requires Python: >=3.6

## CERC Geometry Library

This project is a library with geometry classes with functions built purposely to manipulate geometry representation
of buildings. It has the following classes:
- Plane: has various methods that models a flat surface with no thickness
- Point: contains different methods to manipulate points in 2 and 3 dimensional spaces
- Polygon: contains methods to manipulate different kinds of polygons
- Polyhedron contains a set of methods that manipulate three-dimensional shape with flat polygonal faces