semvec/pypi-packages huggingface dataset:
unix-time 2.0.0
Unix timestamp made easy.

# unix-time

[![](https://badge.fury.io/py/unix-time.svg)](https://pypi.org/project/unix-time)

Unix timestamp made easy.

```py
from unix_time import *

now = ts_now()  # 1568078625, 2019-09-10T01:23:45

yesterday = ts_yesterday()  # 1567987200, 2019-09-09T00:00:00
today = ts_today()  # 1568073600, 2019-09-10T00:00:00
tomorrow = ts_tomorrow()  # 1568160000, 2019-09-11T00:00:00

from datetime import datetime

dt = datetime.fromisoformat('2019-09-10T01:23:45+00:00')

date_plus_time = ts(dt)  # 1568078625, 2019-09-10T01:23:45
date_no_time = ts_date(dt)  # 1568073600, 2019-09-10T00:00:00
```
pysimilarity 0.1.0
Determine similarity between datasets
Requires Python: >=3, <4
Keywords: similarity data machine learning

# pysimilarity

Pysimilarity is a library that contains several methods for determining similarities between groups. Currently, it supports calculating similarities using distances, and a classifier.

## Install

```
pip install pysimilarity
```

## Usage

```
from sklearn.datasets import load_iris
from pysimilarity import DistanceSimilarity
import pandas as pd

iris_dataset = load_iris()
iris_df = pd.DataFrame(iris_dataset['data'],columns=iris_dataset['feature_names']
                      )
iris_df['species'] = pd.Series(iris_dataset['target']).replace({0:'setosa', 1:'versicolor', 2:'virginica'})


dist_similarity = DistanceSimilarity()
setosa_data = iris_df.loc[iris_df.species == 'setosa']
setosa_similarity = dist_similarity.fit_transform(setosa_data.drop('species',axis=1)
                                                  ,iris_df.drop('species',axis=1))
print(setosa_similarity) # Array of shape n_rows of iris_df.
```
pyourls3 1.0.1
A Python 3 API wrapper for YOURLS
Requires Python: >=3.5

# pyourls3

[![Build Status](https://travis-ci.com/codemicro/pyourls3.svg?branch=master)](https://travis-ci.com/codemicro/pyourls3)
[![Mozilla Public Licence v2](https://img.shields.io/badge/Licence-MPL--2.0-yellow.svg)](https://www.mozilla.org/en-US/MPL/)
[![Written for Python 3.7](https://img.shields.io/badge/Written%20for-Python%20<=%203.5-green.svg?logo=python&logoColor=white)](https://www.python.org)

A Python 3 API wrapper for [YOURLS](https://yourls.org/) - Pyourls3 is an API wrapper module written specifically for Python 3, to work with the YOURLS link shortener. It's
designed to supersede the old [`python-yourls`](https://www.github.com/tflink/python-yourls) written by [tflink](https://github.com/tflink),
built using the fantastic [`requests`](https://pypi.org/project/requests/) library.

Documentation can be found at https://www.tdpain.net/projects/pyourls3.

The PyPI page can be found at https://pypi.org/project/pyourls3

## Contibuting
This is an open source project, so feel free to make some changes or fix something, and submit a pull request. See the
contributing page in the docs at https://www.tdpain.net/projects/pyourls3/contributing.html.
keras-util 0.0.2
plots training hystory of Keras model
Requires Python: >=3
Keywords: keras util plot history

# Set of simple helpers for Keras

Some functions that should be included in [Keras](https://keras.io) for user convenience but are too small and forgotten.

Example:  

- Keras training history visualization
```python
import keras_util as u

history = model.fit(..)
u.plot_history(history)

fig, axs = plt.subplots(4,1)
custom_axs = [axs[1], axs[3]]
u.plot_history(history, custom_axs)
````
soylemma 0.2.0
Trained Korean Lemmatizer
Keywords: korean-nlp,nlp,lemmatizer

# 한국어 용언 분석기 (Korean Lemmatizer)

한국어의 동사와 형용사의 활용형 (surfacial form) 을 분석합니다. 한국어 용언 분석기는 다음의 기능을 제공합니다.

1. 입력된 단어를 어간 (stem) 과 어미 (eomi) 으로 분리
1. 입력된 단어를 원형으로 복원

이 패키지의 구현 원리는 [github.io 블로그][io]에 정리하였습니다.

[io]: https://lovit.github.io/nlp/2019/01/22/trained_kor_lemmatizer/

## Usage

### analyze, lemmatize, conjugate

`analyze` function returns morphemes of the given predicator word

```python
from soylemma import Lemmatizer

lemmatizer = Lemmatizer()
lemmatizer.analyze('차가우니까')
```

The return value forms list of tuples because there can be more than one morpheme combination.

```
[(('차갑', 'Adjective'), ('우니까', 'Eomi'))]
```

`lemmatize` function returns lemma of the given predicator word.

```python
lemmatizer.lemmatize('차가우니까')
```

```
[('차갑다', 'Adjective')]
```

If the input word is not predicator such as Noun, it return empty list.

```python
lemmatizer.lemmatize('한국어') # []
```

`conjugate` function returns surfacial form. You should put stem and eomi as arguments. It returns all possible surfacial forms for the given stem and eomi.

```python
lemmatizer.conjugate(stem='차갑', eomi='우니까')
lemmatizer.conjugate('예쁘', '었던')
```

```
['차가우니까', '차갑우니까']
['예뻤던', '예쁘었던']
```

### update dictionaries and rules

For demonstration, we use dictioanry `demo`.

`어여뻤어` cannot be analyzed because the adjective `어여쁘` does not enrolled in dictionary.

```python
from soylemma import Lemmatizer

lemmatizer = Lemmatizer(dictionary_name='demo')
print(lemmatizer.analyze('어여뻤어')) # []
```

So, we add the word with tag using `add_words` function. Do it again. Then you can see the word `어여뻤어` is analyzed.

```python
lemmatizer.add_words('어여쁘', 'Adjective')
lemmatizer.analyze('어여뻤어')
```

```
[(('어여쁘', 'Adjective'), ('었어', 'Eomi'))]
```

However, the word `파랬다` is still not able to be analyzed because the lemmatization rule for surfacial form `랬` does not exist.

```python
lemmatizer.analyze('파랬다') # []
```

So, in this time, we update additional lemmatization rules using `add_lemma_rules` function.

```python
supplements = {
    '랬': {('랗', '았')}
}

lemmatizer.add_lemma_rules(supplements)
```

After that, we can see the word `파랬다` is analyzed, and also conjugation of `파랗 + 았다` is available.

```python
lemmatizer.analyze('파랬다')
lemmatizer.conjugate('파랗', '았다')
```

```
[(('파랗', 'Adjective'), ('았다', 'Eomi'))]
['파랬다', '파랗았다']
```

### debug on

If you wonder which subwords came up as candidates of (stem, eomi), use `debug`.

```python
lemmatizer.analyze('파랬다', debug=True)
```

```
[DEBUG] word: 파랬다 = 파랗 + 았다, conjugation: 랬 = 랗 + 았
[(('파랗', 'Adjective'), ('았다', 'Eomi'))]
```

### lemmatization rule extractor

You can extract lemmatization rule using `extract_rule` function.

```python
from soylemma import extract_rule

eojeol = '로드무비였다'
lw = '로드무비이'
lt = 'Adjective'
rw = '었다'
rt = 'Eomi'

extract_rule(eojeol, lw, lt, rw, rt)
```

```
('였다', ('이', '었다'))
```