Compare commits
No commits in common. "cc0b442f3dd6e6af86ed829d190a6863c11537a2" and "9b94a0b3344dd1b06b8af4f8c8d7a6ebe370fb9d" have entirely different histories.
cc0b442f3d
...
9b94a0b334
@ -1,4 +1,4 @@
|
|||||||
name: Build and Push NLP Docker Image
|
name: Build and Push Docker Image
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@ -9,19 +9,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository with submodules
|
- uses: actions/checkout@v4
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
token: ${{ secrets.ACCESS_TOKEN }}
|
|
||||||
|
|
||||||
- name: Initialize submodules
|
|
||||||
run: |
|
|
||||||
git submodule sync --recursive
|
|
||||||
git submodule update --init --recursive
|
|
||||||
git submodule status
|
|
||||||
ls -la src/modules/db
|
|
||||||
ls -la src/modules/redis
|
|
||||||
|
|
||||||
- name: Login to Registry
|
- name: Login to Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
@ -37,7 +25,7 @@ jobs:
|
|||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Build and Push NLP (multi-arch)
|
- name: Build and Push (multi-arch)
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
@ -46,9 +34,9 @@ jobs:
|
|||||||
build-args: |
|
build-args: |
|
||||||
BUILD_IDENTIFIER=${{ steps.vars.outputs.short_sha }}
|
BUILD_IDENTIFIER=${{ steps.vars.outputs.short_sha }}
|
||||||
tags: |
|
tags: |
|
||||||
gitea.spilum.net/spilum.net/mtf-nlp:${{ steps.vars.outputs.short_sha }}
|
gitea.spilum.net/spilum.net/mtf-nlp:${{ github.ref_name }}-${{ steps.vars.outputs.short_sha }}
|
||||||
gitea.spilum.net/spilum.net/mtf-nlp:latest
|
gitea.spilum.net/spilum.net/mtf-nlp:${{ github.ref_name }}-latest
|
||||||
|
|
||||||
- name: Log out from registry
|
- name: Log out from registry
|
||||||
if: always()
|
if: always()
|
||||||
run: docker logout gitea.spilum.net
|
run: docker logout gitea.spilum.net
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
Subproject commit d84f25c7a672b687c7f9c9e78a4c97a5586036b0
|
Subproject commit 484c5bd8e5a5c77ef2c6a20817205de99cbc77ce
|
||||||
@ -72,45 +72,28 @@ async function classifyIntent(text) {
|
|||||||
|
|
||||||
const INTENTS = await getIntents();
|
const INTENTS = await getIntents();
|
||||||
|
|
||||||
let bestIntent = {
|
let best = {
|
||||||
name: "unknown",
|
name: "unknown",
|
||||||
confidence: 0.5,
|
confidence: 0.5,
|
||||||
matched: null,
|
matched: null,
|
||||||
argument: null
|
|
||||||
};
|
};
|
||||||
|
|
||||||
for (const intent of INTENTS) {
|
for (const intent of INTENTS) {
|
||||||
for (const example of intent.examples) {
|
for (const example of intent.examples) {
|
||||||
const exampleEmbedding = await embed(example);
|
const exampleEmbedding = await embed(example);
|
||||||
const intentScore = cosineSimilarity(inputEmbedding, exampleEmbedding);
|
const score = cosineSimilarity(inputEmbedding, exampleEmbedding);
|
||||||
|
|
||||||
if (intentScore > bestIntent.confidence) {
|
if (score > best.confidence) {
|
||||||
bestIntent = {
|
best = {
|
||||||
name: intent.name,
|
name: intent.name,
|
||||||
confidence: intentScore,
|
confidence: score,
|
||||||
matched: example,
|
matched: example,
|
||||||
argument: intent.arguments
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let bestArgumentScore = 0.5
|
return best;
|
||||||
|
|
||||||
if (bestIntent.argument) {
|
|
||||||
for (const argument of best.arguments) {
|
|
||||||
const argumentEmbedding = await embed(argument);
|
|
||||||
const argumentScore = cosineSimilarity(inputEmbedding, argumentEmbedding);
|
|
||||||
|
|
||||||
if (argumentScore > bestArgumentScore) {
|
|
||||||
bestArgumentScore = argumentScore;
|
|
||||||
|
|
||||||
bestIntent.argument = argument
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return bestIntent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleIntent(streamKey, msg) {
|
async function handleIntent(streamKey, msg) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user