Open Source Package Recommandation

Hello Developers,
Is there any open-source package or algorithm that exists to find out the category from a given text? Like if I provide the text "UK: coronavirus cases, deaths and vaccinations today " it will return a specific category based on this text. Like UK, or Coronavirus. Javascript realated