semvec/pypi-packages huggingface dataset:
simple-wer 0.2
A simple commandline tool for calculating WERs.
Requires Python: >=3.7

# simple-wer
A simple command line tool to calculate WER for ASR.


## Installation

```
pip install simple-wer
```


## Usage

```
$ simple-wer --help
Usage: simple-wer [OPTIONS] REFS HYPS

  The shell entry point to simple-wer, a simple tool to calculate WERs for
  ASR.

  The ``refs`` and ``hyps`` are the paths for references and hypothesis, their
  format should be ``utt_id \t refenence/hypothesis``.

Options:
  --test-name TEXT  The name for current test, it is used to distinguish the
                    file names for different tests.
  --logdir TEXT     The directory to write the WER results.
  --help            Show this message and exit.
```

For example:

The `refs.txt` contains:

```
1       I LOVE YOU
2       I HATE YOU
```

The `hyps.txt` contains:

```
1       i LOVE YOU
2       I hate YOU
```

Run the following command:

```
simple-wer --test-name example refs.txt hyps.txt
```

The logs look like:

```
2023-05-16 11:16:05,253 INFO [simple_wer.py:21] The transcripts are stored in logs/recogs-example.txt
2023-05-16 11:16:05,255 INFO [simple_wer.py:123] [example] %WER 33.33% [2 / 6, 0 ins, 0 del, 2 sub ]
2023-05-16 11:16:05,257 INFO [simple_wer.py:29] Wrote detailed error stats to logs/errs-example.txt
```

There will be two files (`recogs-example.txt` and `errs-example.txt`) in logs,

`recogs-example.txt` looks like:

```
1:      ref=['I', 'LOVE', 'YOU']
1:      hyp=['i', 'LOVE', 'YOU']

2:      ref=['I', 'HATE', 'YOU']
2:      hyp=['I', 'hate', 'YOU']
```

`errs-example.txt` looks like:

```
%WER = 33.33
Errors: 0 insertions, 0 deletions, 2 substitutions, over 6 reference words (4 correct)
Search below for sections starting with PER-UTT DETAILS:, SUBSTITUTIONS:, DELETIONS:, INSERTIONS:, PER-WORD STATS:

PER-UTT DETAILS: corr or (ref->hyp)  
1:      (I->i) LOVE YOU
2:      I (HATE->hate) YOU

SUBSTITUTIONS: count ref -> hyp
1   I -> i
1   HATE -> hate

DELETIONS: count ref

INSERTIONS: count hyp

PER-WORD STATS: word  corr tot_errs count_in_ref count_in_hyp
i   0 1 0 1
hate   0 1 0 1
I   1 1 2 1
HATE   0 1 1 0
YOU   2 0 2 2
LOVE   1 0 1 1
```
finite-difference 0.0.3
Library for setting up finite difference problems
Requires Python: >=3

# Description

This is a library for setting up basic time-dependent finite difference problems. It handles the array manipulation and gives strict errors when a model isn't being set up correctly. However, it does not check for instability, nor does it check whether the model is actually physically accurate.

I see this mainly as an educational tool, although if more features are added it might be helpful for some research.


# Installation

```
pip install finite_difference
```

# Contributing
Any contribution or feedback is very welcome -- feel free to create an issue on github. In particular, if you are getting unexpected behavior or unclear errors, or if there's something you would like to see added, I would want to hear.

# Features
The library can support:
- Regular grid domains with arbitrary number of spatial dimensions
- Periodic or fixed boundary conditions
- Derivative approximations of arbitrary order and arbitrary sampled coordinates
- Time-dependent scalar fields with values at cells or edges between cells

# Example Use

Shown is all the code required for setting up a thermal diffusion model. For more examples, see [the Google Colab](https://colab.research.google.com/drive/1RL2nIeBTFvzbeLya2Qv0NR_kOcZW_Tr9#scrollTo=StZOQhW4wIzp).

1. Create a single Model object for the domain, with a time dimension and space dimension(s).

```python
import finite_difference as fd
m = fd.Model({"x": range(1,100,4), "t": range(1,10)}, time_axis = "t")
```

2. Create fields representing a property that changes over time as a scalar field. 

```python

T = fd.Field(m, "Temperature", n_time_ders = 1)
```

3. Create stencils for numerical approximations of spatial derivatives.

```python

diff_2 = fd.Stencil([-1,0,1], der_order = 2)
```


4. Apply boundary conditions and initial conditions.

```python

T.set_IC("1")
T.set_BC("0","x","start")
T.set_BC("0","x","end")
```

5. Run the simulation in a loop, updating the fields each iteration.

```python

k = 2 # thermal conductivity

m.check_IC() # not required, but recommended: checks if all necessary initial conditions have been set up

while not m.finished: # checks if it has reached the final timestep

    # implements the equations: dT/dt = k * d^2T/dx^2
    Tp = k*diff_2.der(T.prev)
    T.dot.assign_update(Tp)
    T.time_integrate_update()

    m.increment_time() # increment the time step
```

6. Once the run is complete, an interactive visual can be created showing the fields over time. Alternatively, you can get the values of the fields across all time as numpy arrays with the field's data property.


```python
m.interact() # creates an interactive visual in a jupyter notebook

# get numpy array of the temperature:
T.data      
```
seaborn-polars 0.0.2.6
Wrapper for plotting with seaborn using Polars dataframes and lazyframes
Requires Python: >=3.8

# seaborn_polars
Wrapper allowing to use Polars DataFrames and LazyFrames for plotting with seaborn

# Requirements
Python 3.8+

Seaborn, Polars, Pandas, Numpy, Pyarrow

# Installation
Use regular pip install:
```
pip install seaborn_polars pandas numpy polars seaborn pyarrow
```
Alternatively, clone this repository.

# Usage
The package is a wrapper around seaborn plotting functions allowing to use Polars DataFrames and LazyFrames with the same syntax as when using Pandas DataFrames.
```
import polars as pl
import seaborn_polars as snl

df = pl.scan_csv('data.csv')

snl.scatterplot(df, x='rating', y='responses', hue='gender')
```
The package uses a deepcopy of original data. That way the original dataframe remains unaffected. For example, in the code snippet above, if we check the type of `df` after plotting we'll see that it is still a Polars LazyFrame.

All the plotting functions and parameters are identical to seaborn. When using data parameter, it has to be positional-only, the rest of parameters are keyword arguments.