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

context bias for each websocket request #2423

Open
anjul1008 opened this issue Mar 19, 2024 · 7 comments
Open

context bias for each websocket request #2423

anjul1008 opened this issue Mar 19, 2024 · 7 comments
Assignees

Comments

@anjul1008
Copy link

Hi All,

I'm trying to implement context biasing for each websocket request with user provided words.
i have made a few changes in wesocket_server.cc file to accept user context strings and score to build graph.
And graph bulding is perfomed in OnSpeechStart() method.

But looks graph is not updated with newly build graph, it remains same which is build while loading model from params.h.

here are the screenshots of code change:
Screenshot from 2024-03-19 14-56-25
Screenshot from 2024-03-19 14-54-53

Can anyone help me to resolve it, any help would be appreciated.

@anjul1008
Copy link
Author

graph build successfully and memory location got updated.
Screenshot from 2024-03-19 15-12-55

@anjul1008
Copy link
Author

Hi @pengzhendong

i have tried the other approach to, i have added a new method void ContextGraph::UpdateContextGraph(std::string on_request_context_words_, float on_request_context_score_, const std::shared_ptr<fst::SymbolTable>& unit_table) in
context_graph.h header file, which can be called from OnSpeechGraph() method in wesocket_server.cc.

but it leads to following compilation error:

Screenshot from 2024-03-19 17-05-11

Can you please suggest me the where i'm making mistake or better approach to handle request level context graph creation.

@anjul1008
Copy link
Author

i have define it in cc file, now it's working as expected.
thanks

@Mddct
Copy link
Collaborator

Mddct commented Mar 19, 2024

plz make a pr to enhance ?

@anjul1008
Copy link
Author

Hi @Mddct,
i made changes as described above but the context graph is updated which is shared across active connections.
i'll working on it and need to make major changes with shared context resources to non shared websocket connection.

your guidance would be very helpful if you have time.

thank you.

@anjul1008 anjul1008 reopened this Mar 21, 2024
@Mddct
Copy link
Collaborator

Mddct commented Mar 21, 2024

@pengzhendong plz make some advice

@pengzhendong
Copy link
Member

need to make major changes with shared context resources to non shared

LGTM

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

No branches or pull requests

3 participants