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

Simple question: can NLP.js be used for the app I describe? #1360

Open
wktdev opened this issue Nov 3, 2023 · 0 comments
Open

Simple question: can NLP.js be used for the app I describe? #1360

wktdev opened this issue Nov 3, 2023 · 0 comments

Comments

@wktdev
Copy link

wktdev commented Nov 3, 2023

I am learning about thr NLP/LLM/AI domain and I have a small app I want to attempt to complete as a learning exercise. I simply want to know if nlp.js can be used to create the app. If not, what would I need?

Description

The app takes a small subset of user input text and transforms it into a reliable small useable JSON or JS data structure.

Details

The app revolves around these three words:

  • site
  • switch
  • port

These three words reflect the following relationship:
Sites contain switches and switches contain ports. Ports of different switches connect to one another.

User Input

When the user inputs text involving the three key words above, the app needs to transform the text into simple code that reflects the users intent.

Example

If the user says a variation of this:

“On site 2 take switch 4 and connect it’s 3rd port to the 5th port on switch 9”

such as...

"On switch 4 connect port 3 to to port 5 on switch 9. Do this on site number 2 "

It should convert to something in code that reflects the relationship and can easily be parsed.
Both phrases would convert to the same thing. Something like this:

{
  site: 2,
  switches: [{
    number: 4,
    port: 3
  }, {
    number: 9,
    port: 5
  }],
  connections: switches[0].to(switches[1])
}

The code above can be anything as long as it is a data structure that is consistent and keeps the same shape.
First, I am curious if nlp.js can accomplish this, my second question is, is there anything outside the instructions that might be useful or needed?

I know how to write JS and wire up web API's so I should be fine on that end.

Thank you

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

1 participant