Git Product home page Git Product logo

Comments (6)

qpaulson avatar qpaulson commented on August 21, 2024

+1..

from jasper-client.

charliermarsh avatar charliermarsh commented on August 21, 2024

I agree, and I like this idea a lot. I'll see if I can get to it in the near future; otherwise, it'd be a welcome pull request (if you have time).

from jasper-client.

charliermarsh avatar charliermarsh commented on August 21, 2024

On further investigation: the problem with this approach is that the ordering of the modules is actually fairly significant.

In Brain.query(), the brain actually tests the input text against the modules in self.modules in order, stopping with the first module that accepts the input. So the order of the modules defines Jasper's preferences.

As an example, consider the input "Hacker News". Both News.py and HN.py would accept this input (as News.py accepts "News", and HN.py accepts "Hacker News"), but this query is clearly aimed at HN.py, so HN.py is placed before News.py in self.modules. In other words: modules with fewer false positives should go earlier in the list.

To specify this behavior, we could add a PREFERENCE attribute to each module and sort by these preferences after loading them dynamically. This would be similar to the CSS z-index.

from jasper-client.

Matchlighter avatar Matchlighter commented on August 21, 2024

A priority system would work, but it may be a little tricky to keep track of at times. Another possibility would be to setup an ORDER attribute that would work on keys like after:module1 or before:module3.

from jasper-client.

the01 avatar the01 commented on August 21, 2024

Alternatively you could move the list to a settings file. That way it is not hard coded into the application but rather configurable via settings.
It's not as beautiful as dynamically loading them from a dir, but in my opinion you should not have to edit the source code for stuff like that

from jasper-client.

charliermarsh avatar charliermarsh commented on August 21, 2024

Finally got around to this! See 0a377be

from jasper-client.

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.