Giter Club home page Giter Club logo

aniemore's Introduction

Aniemore Logo

Aniemore - это открытая библиотека искусственного интеллекта для потоковой аналитики эмоциональных оттенков речи человека.

Open In Colab

PyPI version PyPI - Python Version PyPI - Wheel PyPI - License PyPI - Status Downloads CodeQL Bandit

Основные технические параметры

  • Объем набора данных Russian Emotional Speech Dialogues содержит более 3000 аудиофрагментов представляющих 200 различных людей;
  • Модели способны распознавать эмоции в зашумленных аудиофайлах длительностью в 3 секунды;
  • Скорость обработки и ответа модели составляет не более 5 секунд;
  • Пословная ошибка модели WER 30%;
  • Совокупная точность модели 75%
  • Диапазон распознавания эмоций: злость, отвращение, страх, счастье, интерес, грусть, нейтрально;
  • Акустические возможности - 3 уровня.

Описание

Aniemore - это библиотека для Python, которая позволяет добавить в ваше программное обеспечение возможность определять эмоциональный фон речи человека, как в голосе, так и в тексте. Для этого в библиотеке разработано два соответсвующих модуля - Voice и Text.

Aniemore содержит свой собственный датасет RESD (Russian Emotional Speech Dialogues) и другие наборы данных разного объема, которые вы можете использовать для обучения своих моделей.

Датасет Примечание
RESD 7 эмоций, 4 часа аудиозаписей диалогов студийное качество
RESD_Annotated RESD + speech-to-text аннотации
REPV 2000 голосовых сообщений (.ogg), 200 актеров, 2 нейтральные фразы, 5 эмоций
REPV-S 140 голосовых сообщений (.ogg) "Привет, как дела?" с разными эмоциями

Вы можете использовать готовые предобученные модели из библиотеки:

Модель Точность
Голосовые модели
wav2vec2-xlsr-53-russian-emotion-recognition 73%
wav2vec2-emotion-russian-resd 75%
wavlm-emotion-russian-resd 82%
hubert-emotion-russian-resd 75%
unispeech-sat-emotion-russian-resd Copied 72%
wavlm-bert-base 81%
wavlm-bert-fusion 83%
Текстовые модели
rubert-base-emotion-russian-cedr-m7 74%
rubert-tiny2-russian-emotion-detection 85%
rubert-large-emotion-russian-cedr-m7 76%
rubert-tiny-emotion-russian-cedr-m7 72%

Показатели моделей в разрезе эмоций

показатели моделей.jpg

Установка

pip install aniemore

Минимальные требования к оборудованию

Архитектура ЦПУ ОЗУ SSD
Wave2Vec2 2 ядра 8 ГБ 40 ГБ
WaveLM 2 ядра 8 ГБ 40 ГБ
Hubert 2 ядра 8 ГБ 40 ГБ
UniSpeechSAT 2 ядра 8 ГБ 40 ГБ
Bert_Tiny/Bert_Tiny2 2 ядра 4 ГБ 40 ГБ
Bert_Base 2 ядра 4 ГБ 40 ГБ
Bert_Large 2 ядра 8 ГБ 40 ГБ
WavLM Bert Base 2 ядра 16 ГБ 40 ГБ
WavLM Bert Fusion 2 ядра 16 ГБ 40 ГБ
Whisper Tiny 2 ядра 4 ГБ 40 ГБ
Whisper Base 2 ядра 4 ГБ 40 ГБ
Whisper Small 2 ядра 4 ГБ 40 ГБ
Whisper Medium 2 ядра 8 ГБ 40 ГБ
Whisper Large 2 ядра 16 ГБ 40 ГБ
TextEnhancer 2 ядра 4 ГБ 40 ГБ

Пример использования

Ниже приведены простые примеры использования библиотеки. Для более детальных примеров, в том числе загрузка cобственной модели - смотрите сделанный для этого Google Colab

Open In Colab

Распознавание эмоций в тексте

import torch
from aniemore.recognizers.text import TextRecognizer
from aniemore.models import HuggingFaceModel

model = HuggingFaceModel.Text.Bert_Tiny2
device = 'cuda' if torch.cuda.is_available() else 'cpu'
tr = TextRecognizer(model=model, device=device)

tr.recognize('это работает? :(', return_single_label=True)

Распознавание эмоций в голосе

import torch
from aniemore.recognizers.voice import VoiceRecognizer
from aniemore.models import HuggingFaceModel

model = HuggingFaceModel.Voice.WavLM
device = 'cuda' if torch.cuda.is_available() else 'cpu'
vr = VoiceRecognizer(model=model, device=device)
vr.recognize('/content/ваш-звуковой-файл.wav', return_single_label=True)

Распознавание эмоций (мультимодальный метод)

import torch
from aniemore.recognizers.multimodal import VoiceTextRecognizer
from aniemore.utils.speech2text import SmallSpeech2Text
from aniemore.models import HuggingFaceModel

model = HuggingFaceModel.MultiModal.WavLMBertFusion
s2t_model = SmallSpeech2Text()

text = SmallSpeech2Text.recognize('/content/ваш-звуковой-файл.wav').text
device = 'cuda' if torch.cuda.is_available() else 'cpu'

vtr = VoiceTextRecognizer(model=model, device=device)
vtr.recognize(('/content/ваш-звуковой-файл.wav', text), return_single_label=True)

Распознавание эмоций (мультимодальный метод с автоматическим распознаванием речи)

import torch
from aniemore.recognizers.multimodal import MultiModalRecognizer
from aniemore.utils.speech2text import SmallSpeech2Text
from aniemore.models import HuggingFaceModel

model = HuggingFaceModel.MultiModal.WavLMBertFusion
device = 'cuda' if torch.cuda.is_available() else 'cpu'
mr = MultiModalRecognizer(model=model, s2t_model=SmallSpeech2Text(), device=device)
mr.recognize('/content/ваш-звуковой-файл.wav', return_single_label=True)

Доп. ссылки

Все модели и датасеты, а так же примеры их использования вы можете посмотреть в нашем HuggingFace профиле

Аффилированость

Aniemore (Artem Nikita Ilya EMOtion REcognition)

Разработка открытой библиотеки произведена коллективом авторов на базе ООО "Социальный код". Результаты работы получены за счет гранта Фонда содействия развитию малых форм предприятий в научно-технической сфере (Договор №1ГУКодИИС12-D7/72697 от 22.12.2021).

Цитирование

Для цитировация воспользуйтесь пунктом Cite this repository в правом меню About этого проекта, или скопируйте информацию ниже:

@software{Lubenets_Aniemore,
author = {Lubenets, Ilya and Davidchuk, Nikita and Amentes, Artem},
license = {MIT},
title = {{Aniemore}},
url = {https://github.com/aniemore/Aniemore}
}

aniemore's People

Contributors

ar4ikov avatar artemamentes avatar toiletsandpaper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

aniemore's Issues

Проблема при инициализации моделей

Некоторые веса в модели инициализируются заново вместо загрузки из HuggingFace. Неизвестно ,как это влияет на результат, но появляется ворнинг.

import torch
from aniemore.recognizers.voice import VoiceRecognizer
from aniemore.models import HuggingFaceModel

model = HuggingFaceModel.Voice.UniSpeech
device = 'cuda' if torch.cuda.is_available() else 'cpu'
vr = VoiceRecognizer(model=model, device=device)

Ниже всплывающие ворнинги

pytorch_model.bin: 100%|███████████████████████████████████████████████████████████| 1.27G/1.27G [03:38<00:00, 5.79MB/s]
Some weights of the model checkpoint at aniemore/unispeech-sat-emotion-russian-resd were not used when initializing UniSpeechSatForSequenceClassification: ['unispeech_sat.encoder.pos_conv_embed.conv.weight_v', 'unispeech_sat.encoder.pos_conv_embed.conv.weight_g']
- This IS expected if you are initializing UniSpeechSatForSequenceClassification from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).
- This IS NOT expected if you are initializing UniSpeechSatForSequenceClassification from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).
Some weights of UniSpeechSatForSequenceClassification were not initialized from the model checkpoint at aniemore/unispeech-sat-emotion-russian-resd and are newly initialized: ['unispeech_sat.encoder.pos_conv_embed.conv.parametrizations.weight.original0', 'unispeech_sat.encoder.pos_conv_embed.conv.parametrizations.weight.original1']
You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.
preprocessor_config.json: 100%|████████████████████████████████████████████████████████| 212/212 [00:00<00:00, 1.48MB/s]
Some weights of the model checkpoint at aniemore/unispeech-sat-emotion-russian-resd were not used when initializing UniSpeechSatForSequenceClassification: ['unispeech_sat.encoder.pos_conv_embed.conv.weight_v', 'unispeech_sat.encoder.pos_conv_embed.conv.weight_g']
- This IS expected if you are initializing UniSpeechSatForSequenceClassification from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).
- This IS NOT expected if you are initializing UniSpeechSatForSequenceClassification from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).
Some weights of UniSpeechSatForSequenceClassification were not initialized from the model checkpoint at aniemore/unispeech-sat-emotion-russian-resd and are newly initialized: ['unispeech_sat.encoder.pos_conv_embed.conv.parametrizations.weight.original0', 'unispeech_sat.encoder.pos_conv_embed.conv.parametrizations.weight.original1']
You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.