semvec/pypi-packages huggingface dataset:
lokilogger 1.0.3
This a custom `logging` for `Loki`
Requires Python: >=3.8,<4.0

# Lokilogger

## Introduction

This package is just a wrapper around [logging](https://docs.python.org/3/library/logging.html) and [colorlog](https://github.com/borntyping/python-colorlog).

## Installation

```shell
pip install lokilogger
```

## Usage

At the start of your program

```python
from lokilogger.logging import set_log_mode
import logging

env = os.getenv("LOGMODE", "DEV")
set_log_mode("env") # A global setting here, you can set it to `PROD`, `DEV`or `DEV_NO_COLOR`
```

Use it in other modules

```python
logger = logging.getLogger(__name__)
logger.error('error message')
```

Output

env=Prod

```shell
"time": "2022-01-15 07:56:05,440, ""severity": "INFO", "logger": "root","module": "logging", "message": "Dev env is set to production"
"time": "2022-01-15 07:56:05,440, ""severity": "ERROR", "logger": "__main__","module": "test", "message": "error message"
"time": "2022-01-15 07:56:05,440, ""severity": "INFO", "logger": "root","module": "test", "message": "error message"
```

env=DEV_NO_COLOR

```shell
2022-01-15 07:54:40,039 | INFO | root | Dev env is set to development without colorlog
2022-01-15 07:54:40,039 | ERROR | __main__ | error message
2022-01-15 07:54:40,039 | INFO | root | error message
```
bertstem 0.0.33
BERT model fine-tuned on chilean STEM lessons
Requires Python: >=3.6

# BERT-STEM

BERT model fine-tuned on Science Technology Engineering and Mathematics (STEM) lessons.

## Install:

To install from pip:

```
pip install bertstem
```

## Quickstart

To encode sentences :

```python
from BERT_STEM.BertSTEM import *
bert = BertSTEM()

# Example dataframe with text in spanish
data = {'col_1': [3, 2, 1], 
'col_2': ['hola como estan', 'alumnos queridos', 'vamos a hablar de matematicas']}

df = pd.DataFrame.from_dict(data)

# Encode sentences using BertSTEM:
bert._encode_df(df, column='col_2', encoding='sum')

```
To classify sentences with COPUS models:

```python
from BERT_STEM.BertSTEM import *

# Download BERT for classification (guiding/presenting/administration)
bert_classification = BertSTEMForTextClassification(2, model_name = 'pablouribe/bertstem-copus-guiding')

# Example dataframe with text in spanish
data = {'col_1': [3, 2, 1], 
'col_2': ['hola como estan', 'alumnos queridos', 'vamos a hablar de matematicas']}

df = pd.DataFrame.from_dict(data)

# Classify sentences using BertSTEM for COPUS (Guiding):
bert_classification.predict(df,'col_2')

```


To use it from HuggingFace:

```python
from BERT_STEM.Encode import *
import pandas as pd
import transformers

# Download spanish BERTSTEM:
model = transformers.BertModel.from_pretrained("pablouribe/bertstem")

# Download spanish tokenizer:
tokenizer = transformers.BertTokenizerFast.from_pretrained("dccuchile/bert-base-spanish-wwm-uncased",
                                                            do_lower_case=True, 
                                                            add_special_tokens = False)

# Example dataframe with text in spanish
data = {'col_1': [3, 2, 1], 
        'col_2': ['hola como estan', 'alumnos queridos', 'vamos a hablar de matematicas']}
        
df = pd.DataFrame.from_dict(data)

# Encode sentences using BertSTEM:
sentence_encoder(df, model, tokenizer, column = 'col_2', encoding = 'sum')
```