Comments (11)
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.
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.
@omerdagan84 Please have a look
from virtual-assistant.
We need to figure out some way or change the approach, That's tricky here
from virtual-assistant.
@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.
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.
And will there be insertions of new words/phrases at runtime?
from virtual-assistant.
@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.
I think you can close this issue
from virtual-assistant.
@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.
@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)
- Update Knowledge base (corpus)
- Ineligible Repository For Hacktoberfest HOT 2
- Introduce make install and uninstall in makefile HOT 3
- Things defined in main.c also defined in init_config.c HOT 3
- [ideas pls] what to contribute HOT 1
- Some code safety insights HOT 1
- running into problems trying to compile the code
- Does the strlen function need to be recalculated every round of the for loop? HOT 1
- blank spaces HOT 4
- Code structure HOT 9
- ALSA lib pcm_dmix.c:1108 error HOT 3
- README addition for EMAIL
- Increase array size HOT 3
- Add support for MacOs
- Issue with classification HOT 7
- Create Documentation HOT 10
- Create a Makefile HOT 4
- Reorgainize preprocessor macros to outside of main function calls HOT 4
- Add basic math capabilities HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from virtual-assistant.