semvec/pypi-packages huggingface dataset:
streamlit-text-label 0.1.2
Components for labelling text document
Requires Python: >=3.7

# streamlit-text-label

Custom streamlit component for labelling text selections, based on [Label Studio](https://github.com/heartexlabs/label-studio-frontend).
![Demo](https://user-images.githubusercontent.com/1639722/136137713-752622a5-25f0-42b2-9645-a800674bff31.gif)

## Usage

Prerequisite:

- python >= 3.7

```python
from streamlit_text_label import label_select

selections = label_select(body="lorem ipsum", labels=["Noun", "Verb"])
```

More details in [example](example/app.py) directory.

## Develop

```bash
docker-compose up --build
```

Or manually, start the frontend

```bash
cd streamlit_text_label/frontend
npm install
npm run start
```

Followed by the example app

```bash
pip install -r example/requirements.txt
RELEASE=DEV streamlit run example/app.py
```

## Publish

```bash
cd component/frontend
npm run build
cd ../..
python setup.py sdist bdist_wheel
```

## Known Issues

- [ ] Labelling standalone whitespaces will not work.
- [ ] Trailing and leading whitespace will be included in selection but not rendered.
- [ ] Label colors are generated from the first 6 characters of its own MD5 hash, which may clash and have low contrast (native HSL doesn't work fully with LS).
- [ ] Each selection renders best with 1 label only. If you need multiple labels, create multiple selections.
ScenarioReducer 1.0.0
Scenario Reduction Algorithms in Stochastic Programming
Requires Python: >=3.6
Keywords: stochastic-programming,probability-metric,scenario-reduction,scenario-tree

# ScenarioReducer

![License](https://img.shields.io/github/license/DanieleGioia/ScenarioReducer)
![Issues](https://img.shields.io/github/issues/DanieleGioia/ScenarioReducer)

This library implements several approximate scenario reduction algorithms. Given a probability distribution with finite support, they aim to determine a probability measure with support of reduced and fixed cardinality by selecting the closest to the original one in terms of a selected statistical distance.

## Installation

1. (Recommended) The easiest way to install and use ScenarioReducer is through pip:

    ```Bash
        pip install ScenarioReducer
    ```

2. (Alternative) You can directly clone the repository

    ```Bash
        git clone https://github.com/DanieleGioia/ScenarioReducer.git
    ```

## Code structure

```Bash
|____main_example.py
|____scenarioReducer
| |____scenario_reducer.py
| |______init__.py
| |____fast_forward.py
|____tests
| |____test_fast_forward.py
```

### ScenarioReducer Class

It is an abstract class for a scenario reducer that suggests the methods that a scenario reducer should possess. The main method **reduce**,  given a fixed n, must reduce an original set of scenarios with cardinality N to a smaller one of cardinality n.

Different strategies can vary, for example, w.r.t.:

- The statistical distance.
- The selection order (Fast Forward, Backward, Simultaneous Backward, ...).

### Fast_forward class

This class implements a scenario reducer that follows a *Fast Forward* (FF) technique from:

[1] Heitsch, Holger, and Werner Römisch. "Scenario reduction algorithms in stochastic programming." Computational optimization and applications 24.2-3 (2003): 187-206.

FF is preferred for $n\le \frac{N}{4}$ , where $n$  is the new reduced cardinality of the support and $N$ is the original one. For further details please refer to the article.

### Example

An easy example to familiarize yourself with the library is provided in **main_example.py**

### Available tests

1. *test_fast_forward* creates a starting set of one-dimensional Gaussian distributed scenarios of known mean and variance. The test then uses the *Fast_Forward* class to reduce the number of scenarios. Mean, standard deviation, and 0.05, 0.5, and 0.95 quantiles are eventually compared between the original scenario set and the reduced scenario set to confirm that such statistical measures are close.
shgpy 0.8.6
A collection of utilities for analyzing SHG data.
Requires Python: >=3.6

# ShgPy
[![DOI](https://zenodo.org/badge/267391726.svg)](https://zenodo.org/badge/latestdoi/267391726)

ShgPy is a simple toolkit for analyzing rotational-anisotropy second harmonic generation (RA-SHG) data. It depends mainly on three packages, [NumPy](https://numpy.org/), [SciPy](https://www.scipy.org/), and [SymPy](https://www.sympy.org/en/index.html) -- as well as (optionally) [Matplolib](https://matplotlib.org/) for some basic plotting capability -- to simulate, manipulate, and fit RA-SHG data in a (hopefully!) intuitive way.

Fitting RA-SHG data involves solving a complex global minimization problem with many degrees of freedom. Moreover, the fitting functions naively involve a degree of complexity due to the trigonometric nature of the problem. This software therefore takes a dual approach to fitting RA-SHG data -- first of all, all of the fits are done in Fourier space, which significantly reduces the complexity of the fitting formulas, and second of all, ShgPy makes heavy use of the [scipy.optimize.basinhopping](https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.basinhopping.html) algorithm, which is particularly useful for these types of global optimization problems.

For more information, please see the [tutorials and documentation](https://bfichera.github.io/shgpy/).