Your algorithm would have to maintain a table (or something similar)
Word Category
-------------------------------------
algo algorithm
design algorithm
...
...
libraries library
open open-source
open-source open-source
paper research-paper
research research-paper
source source-code
...
When you analyze the statement according to this table (after ignoring filler words)
1. "Any open source libraries or research papers on this?"
2. open source libraries research papers
3.
open open-source
source source-code
open-source open-source
libraries library
research research-paper
paper research-paper
research-paper research-paper
4. by a simple majority, (you can also use a more complex algorithm here,
like assigning weights to the Categories)
selected category = research paper
As you keep on learning using your selected algorithm, your table keeps on getting updated, and you keep getting better results.