Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dream distribution with SF-based DM #572

Merged
merged 87 commits into from
Jan 15, 2024
Merged

Conversation

nstsj
Copy link
Collaborator

@nstsj nstsj commented Sep 26, 2023

  • branch renamed as Dilya suggested
  • distribution folder at 'dream/assistant_dists/dream_SFC_based_dm' renamed to 'dream/assistant_dists/dream_ranking_and_sfc_based_dm'


RUN pip install -r requirements.txt && \
python -c "import nltk; nltk.download('punkt')"
RUN pip install git+https://github.com/deeppavlov/DeepPavlov.git@feat/speech-fn && \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

замените с ветки на конкретный комит

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а лучше даже релиз

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

НАПОМИНАЮ

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -0,0 +1,17 @@
services:
agent-tg:
command: sh -c 'bin/wait && python -m deeppavlov_agent.run agent.channel=telegram agent.telegram_token=$TG_TOKEN agent.pipeline_config=assistant_dists/dream_Speech_models_based/pipeline_conf.json agent.db_config=assistant_dists/dream_Speech_models_based/db_conf.json'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

название дистрибутива

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

чекнула, сейчас актуальное название дистрибутива: dream_ranking_and_sf_based_dm

@@ -4,8 +4,7 @@ component_type: null
model_type: NN-based
is_customizable: false
author: publisher@deeppavlov.ai
description: a hierarchical algorithm based on several linear models and a rule-based
approach for the prediction of speech functions described by Eggins and Slade
description: an algorithm based on NN
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make a more detailed descriptions

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

НАПОМИНАЮ

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

components/XWQGXXbppnHZVm1hyDIw.yml Show resolved Hide resolved
LANGUAGE: EN
FALLBACK_FILE: fallbacks_dream_en.json

ranking-based-response-selector:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

???

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -0,0 +1,444 @@
services:
agent:
command: sh -c 'bin/wait && python -m deeppavlov_agent.run agent.channel=telegram agent.telegram_token=$TG_TOKEN agent.pipeline_config=assistant_dists/dream_Speech_models_based/pipeline_conf.json agent.db_config=assistant_dists/dream_Speech_models_based/db_conf.json'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dist name

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checked, the name is correct now, dream_ranking_and_sf_based_dm

limits:
memory: 1G
reservations:
memory: 1G
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure?

combined-classification:8087, fact-retrieval:8100, entity-detection:8103,
speech-function-classifier:8108,
sentence-ranker:8128, property-extraction:8136, prompt-selector:8135, openai-api-chatgpt:8145,
openai-api-chatgpt-16k:8167, summarization-annotator:8058, dialog-summarizer:8059"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you remove ALL llm-based skills?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not completely understand - where is a new response selector? you had to create a new response selector, and make a function to integrate SF to response selection

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good question. The removal was accidental and unintentional, we're taking them back rn

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • new response selector has arrived
  • regarding llm-based skills, we had to drop dff-dream-faq-prompted-skill, dff-google-api-skill and dff-dream-persona-chatgpt-prompted-skill bc they require api keys which we didnt have atm. If the skills are crucial, we'll add them back when we know what to add to .env_secret file

combined-classification:8087, fact-retrieval:8100, entity-detection:8103,
speech-function-classifier:8108,
sentence-ranker:8128, property-extraction:8136, prompt-selector:8135, openai-api-chatgpt:8145,
openai-api-chatgpt-16k:8167, summarization-annotator:8058, dialog-summarizer:8059"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not completely understand - where is a new response selector? you had to create a new response selector, and make a function to integrate SF to response selection


RUN pip install -r requirements.txt && \
python -c "import nltk; nltk.download('punkt')"
RUN pip install git+https://github.com/deeppavlov/DeepPavlov.git@feat/speech-fn && \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

НАПОМИНАЮ

LANGUAGE: EN
FALLBACK_FILE: fallbacks_dream_en.json

ranking-based-response-selector:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

заменить во всей папке с дистрибутивом на нужный

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Есть

components/XWQGXXbppnHZVm1hyDIw.yml Show resolved Hide resolved
except ValueError:
logger.info(f"Speech function index could not be found from {hyp}, id: {hyp_id}.")

scores[hyp_id] += speech_predictor_scores[speech_index]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

эта строчка должна быть внутри try-except scope, который выше

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Есть

speech_predictor_scores = [v["confidence"] for v in speech_predictor]
speech_index = None
try:
speech_index = speech_predictor_hyps.index(hyp)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

кажется, здесь должно быть не (hyp),а классы, присвоенные аннотатором гипотез hyp.get("annotations", {}).get("speech_function_classifier", {})

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Действительно, просмотрел этот момент. Изменил.

SERVICE_PORT: 8081
SERVICE_NAME: response_selector
SENTENCE_RANKER_ANNOTATION_NAME: sentence_ranker
SENTENCE_RANKER_SERVICE_URL: http://sentence-ranker:8128/respond
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

убрать нэти файлы и создать карточки-файлы под твой респонс селектор

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

"service": "services/response_annotator_selectors/service_configs/agent"
}
},
"candidate_annotators": {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

чтоыб сверять речевые функции гипотез с предсказанными предиктором, нужно аннотировать гипотезы с помощью speech-function-classifier

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ПИНГ

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Есть

res = dialog["human_utterances"][-1]["annotations"].get("speech_function_classifier", [""])
logger.info(f"formatter log sfp/sfc: {res}")
except Exception as e:
logger.error(f"Failed to format sfc output: {e}")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

в чем может быть ошибка?

dilyararimovna
dilyararimovna previously approved these changes Jan 12, 2024
@dilyararimovna dilyararimovna changed the title [WIP] Dream distribution with SF-based DM Dream distribution with SF-based DM Jan 15, 2024
@dilyararimovna dilyararimovna merged commit 8f4d876 into dev Jan 15, 2024
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants