Low weight Natural Language Processing

Wanted to experiment with using a little bit of natural language processing to have more fluid interactions with npc in a text game, so farm my idea is to take the player text and parse it to convert in a set of general tokens and then match sequences of said tokens to prewritten answers or actions. so "how much this sword costs?" might become
[Question::Quantity, Local, Uncategorized(sword), Price]
an be matched with an answer for the price of the sword
i am curious what's the general consensus on this approach and if you have any advice to make sure it can stay performant even with many possible therms or answers

This seems very achievable. This can be a seen as a combination of sequence classification (what kind of question/action is this?) and token classification (which words in the input provide the various parameters for the action). The restricted nature of the outputs means that you can use small/fast models.

Depending on how "smart" you need the system to be, you could solutions ranging from simple pattern matching (split input into words, apply some normalization, look for matches for phrases like "how much"), classic NLP (spaCy), all the way up to a fine-tuned small BERT model such as DistilBERT. For the more sophisticated approaches, the de-facto tools for this are all written in Python, so you might want to use that for prototyping, and then figure out how to port it to Rust.