Giter Club home page Giter Club logo

Comments (11)

omerdagan84 avatar omerdagan84 commented on May 18, 2024 1

i'm not sure we can avoid some of these loops since all categories must be scanned,
But i can suggest moving the scoring internal loop to a function and creating threads to score each class, this will definitely lower the time complexity (However this will not improve the code complexity)

from virtual-assistant.

mcavazotti avatar mcavazotti commented on May 18, 2024 1

Hey there, I just landed on this page from up-for-grabs.net, so I don't know much about this project.
From what I understood from the code snipet, you are searching words across categories, right. Wouldn't a tree structure help with the time complexity. You could use a Radix tree, and the node could be something like this:

typedef struct {
   Node* left; // left child
   Node* right; // right child
   char * key;
   Category* categories; // let's assume that this is the name of the class/type
} Node;

I hope this comment helped a bit.

from virtual-assistant.

ritwik12 avatar ritwik12 commented on May 18, 2024

@omerdagan84 Please have a look

from virtual-assistant.

ritwik12 avatar ritwik12 commented on May 18, 2024

We need to figure out some way or change the approach, That's tricky here

from virtual-assistant.

ritwik12 avatar ritwik12 commented on May 18, 2024

@mcavazotti Hey, thanks for taking interest. good to hear you landed from up-for-grabs.net, I am there too :P

Radix tree would just be a DS to store those words instead of values. While iterating through them it will still be the same.

Can you please share an example for this. You can see here for analysis part with which we assign categories to the input sentence.
Categories are defined here in define.h

Radix tree might be of use for defining categories I suppose, is there a way to help in reducing complexity with that?

from virtual-assistant.

mcavazotti avatar mcavazotti commented on May 18, 2024

While working on it, I thought about other algorithms. The main difference comes down to memory usage. Being said that, where do you intend to run this assistant (Raspberry PI, personal computer, etc)? And how many phrases/words do you expect to classify (thousands, 10k, 1M)?

from virtual-assistant.

mcavazotti avatar mcavazotti commented on May 18, 2024

And will there be insertions of new words/phrases at runtime?

from virtual-assistant.

ritwik12 avatar ritwik12 commented on May 18, 2024

@mcavazotti For now this is intended to Systems only mainly PC, Laptops. Also, about the phrases it should not be more than 50-100 words even if you are searching something on the internet. We can always restrict the max. use of phrases as this project is intented towards being a Virtual assistant and performaning the tasks which should not have that much keywords.

At runtime it is just the insertion of user input/ query/ command to give the Virtual assistant and perform the task. If by phrases you meant the Knowledge base/ Corpus then that is limited to 5 for now I guess and it is not being inserted at run time.

from virtual-assistant.

mcavazotti avatar mcavazotti commented on May 18, 2024

I think you can close this issue

from virtual-assistant.

ritwik12 avatar ritwik12 commented on May 18, 2024

@mcavazotti The code is pretty huge and there are still many Complexity improvements and a lot of which are not yet been discovered. Don't think we can close this.

from virtual-assistant.

mcavazotti avatar mcavazotti commented on May 18, 2024

@ritwik12 Well then, for the code mentioned in this issue, the time complexity was optimized.

I can look further into the code, but do you have any other leads to where there might be other performance bottlenecks?

from virtual-assistant.

Related Issues (20)

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.