1from gliner import GLiNER
2
3labels = ["Person", "Location", "Organization", "Event", "Product", "Address", "URL"]
4
5news_en = """On September 1, 2025, OrionSoft Inc., a California-based technology company, announced the opening of its new Artificial Intelligence Research Lab in Vienna, Austria.
6The CEO, Dr. Laura Stein, explained during a press conference at the Hotel Imperial that the lab will focus on multilingual natural language processing and AI ethics. The project is being supported by the Austrian Federal Ministry for Digital Affairs and will collaborate closely with TU Wien and Oxford University.
7According to Stein, OrionSoft plans to hire more than 120 researchers in the next two years, with the first products expected under the Aurora AI brand by mid-2026."""
8
9news_de = """Am 1. September 2025 hat der in Kalifornien ansässige Technologiekonzern OrionSoft Inc. die Eröffnung seines neuen Forschungszentrums für Künstliche Intelligenz in Wien, Österreich bekanntgegeben.
10Die Geschäftsführerin, Dr. Laura Stein, erklärte auf einer Pressekonferenz im Hotel Imperial, dass sich das Labor auf mehrsprachige Sprachverarbeitung und KI-Ethik konzentrieren werde. Unterstützt wird das Projekt vom Bundesministerium für Digitalisierung und in enger Zusammenarbeit mit der TU Wien sowie der Universität Oxford.
11Laut Stein will OrionSoft in den nächsten zwei Jahren mehr als 120 Forscherinnen und Forscher einstellen. Erste Produkte sollen bereits Mitte 2026 unter der Marke Aurora AI erscheinen."""
12
13model = GLiNER.from_pretrained("llinauer/gliner_de_en_news")
14
15ents_de = model.predict_entities(news_de, labels)
16ents_en = model.predict_entities(news_en, labels)
17
18print({f'{e["text"]}:{e["label"]}' for e in ents_de})
19>>> {'Österreich:Location', 'Wien:Location', 'OrionSoft:Organization', 'Aurora AI:Product', 'Universität Oxford:Organization', 'TU Wien:Organization', 'Hotel Imperial:Location', 'Labor:Location', 'Laura Stein:Person', 'Stein:Person', 'Bundesministerium für Digitalisierung:Organization', 'Kalifornien:Location', 'OrionSoft Inc.:Organization', 'Pressekonferenz:Event'}
20
21print({f'{e["text"]}:{e["label"]}' for e in ents_en})
22>>> {'California-based:Location', 'Austria:Location', 'Austrian Federal Ministry for Digital Affairs:Organization', 'Artificial Intelligence Research Lab:Location', 'Aurora AI:Product', 'TU Wien:Organization', 'press conference:Event', 'Hotel Imperial:Location', 'Laura Stein:Person', 'Oxford University:Organization', 'Vienna:Location', 'Stein:Person', 'OrionSoft:Organization', 'OrionSoft Inc.:Organization', 'lab:Location'}
23
24