D a NLP : An open-source toolkit for D anish Natural Language Processing (2021)

Abstract: We present an open-source toolkit for Danish Natural Language Processing, enabling easy access to Danish NLP’s latest advancements. The toolkit features wrapper-functions for loading models and datasets in a unified way using third-party NLP frameworks. The toolkit is developed to enhance community building, understanding the need from industry and knowledge sharing. As an example of this, we present Angry Tweets: An Annotation Game to create awareness of Danish NLP and create a new sentiment-annotated dataset.

## introduction danish is the official language in denmark. it is mainly spoken by the approximately 6m people in denmark 1 . in natural language processing (nlp), danish is considered a medium-resource language @xcite . there is, however, limited availability of danish models and tools @xcite . we believe to increase the availability of nlp resources, we need to engage academia and industry to leverage synergy effects. in this demonstration paper, we present an open-source, danish nlp toolkit: danlp. it contains trained models for named entity recognition (ner), part-of-speech (pos) tagging, sentiment analysis, parsing, coreference resolution as well as word embeddings and datasets. it is developed in close collaboration with industry and academic partners and aims at strengthening knowledge sharing and community building. the toolkit makes recent advances in danish nlp more available and applicable. it is a single entry for accessing danish nlp resources through a consistent interface. the toolkit consists of resources developed by others and new models and datasets developed within the project guided by what is presently relevant for industry. in the same spirit, we ensure industry-friendly licences, i.e., the resources are licensed for commercial use, ideally without copyleft restrictions. the toolkit employs a unified syntax for loading and applying models inspired by frameworks like scikit-learn @xcite and spacy @xcite . the overall scope of the danlp project is to engage a community of professionals from academia and industry around danish nlp. as a way of showcasing what is needed concerning annotation and to engage people in the development of danish nlp tools, a crowdsourcing game is launched as part of the project. this paper's main contribution is to demonstrate a resource enabling industry's adoption of nlp for a medium-resource language. ## the danlp toolkit the danlp toolkit contains wrapper functions utilising well-maintained third-party nlp frameworks such as spacy @xcite , flair @xcite , gensim @xcite and transformers @xcite . the documentation 3 for the toolkit provides an overview of the resources with credits to developers, benchmark results, training details, and code snippets for loading and using the models and datasets. the resources available through the toolkit include both resources developed by others and resources developed specifically as part of the danlp project. therefore, in the following subsections, a † indicates that a resource was created/ trained/annotated as part of the danlp project. in the opposite case, a reference is supplied. ## angry tweets: an annotation game to advance the field of danish nlp, there is a need for task-specific annotated corpora for training and benchmarking models. @xcite . the danlp project has previously annotated a corpus using a traditional approach, i.e., with a few trained annotators. however, such annotations are expensive and timeconsuming. therefore, we propose collaborative crowdsourcing, designed as a game. a similar approach is previously seen in @xcite . like their gamified emotion annotation setup, we also asked participants to annotate a few goldannotated sentences as well as sentences previously annotated by other crowd annotators in order to assess the annotation. the main motivation, besides creating a new twitter sentiment corpus for the toolkit, was engaging professionals and other people interested in the development of danish nlp and communicating what is needed in terms of annotation work. the game was, therefore, announced through social media, a blog post, and the danish medium data tech. 12 the hope was to motivate volunteer participants to contribute to the development of danish nlp. the gamification element (failing is an option, and there was also a possibility to win a symbolic prize) is meant to peak people's interest and motivate them to supply high-quality annotations. we made an effort to keep a light and fun tone with a storyline including a swan, the project logo. the game interface the game consists of eight rounds with four tweets per round. figure 1 shows one round. the tweets are annotated with threeclass sentiment (positive, neutral, negative). as a part of a defensive task design @xcite , participants were on every second page asked to annotate one gold-annotated tweet, and on each round, the completion time was measured. not passing any of these checks triggered game over. in each round, participants annotated one sentence already annotated by another annotator and was rewarded with a point if their annotation matched the previous annotation. ## knowledge in knowledge out the development of danlp is industry-focused. therefore, the danlp team is in dialogue with danish companies and government agencies to understand their needs. the project also shares knowledge and disseminates. throughout the project, there have been dialogues with around 35 companies consisting of both start-ups and larger tech companies, as well as eight different government agencies. there is a large spread in the maturity of using and understanding nlp across organisations. some companies are pushing the field of danish nlp forward, and their requests are generally more data; large, raw text corpora and annotated corpora. other companies are new to the field and mostly driven by curiosity, and a third category consists of companies with a more task-oriented desire. here, we especially noted a need for better performing models for ner and sentiment analysis. therefore, these tasks were the initial focus of the toolkit. to stay in close contact with industry, two collaborations with companies were constituted: one with a media monitoring company, infomedia a/s, to improve their existing ner system for news articles. the other collaboration was with the danish broadcasting corporation to monitor the mood on their social media platform. the knowledge-sharing part is aimed at making more people and companies aware of the possibilities of nlp. therefore the project includes a blog on danish nlp foot_10 , nlp introduction talks, and a demonstration page to show some of the models in action. the toolkit has so far benefited from bug reports, bug fixes, and suggestions for improvements from contributors through our github repository. 15 the ambition is to have an even stronger community contributing to the toolkit with new models and datasets. the ambition is that the toolkit in time becomes more community-driven. it is also within the project's scope to contribute to nlp frameworks to enable danish's direct support. before danlp, spacy did not support danish since an open-source ne dataset was lacking. however, with dane, @xcite this was fulfilled and is now part of spacy. 16 the flair tagging models for pos and ner trained as part of danlp are now also available directly trough flair. nevertheless, the need for improving danish nlp goes beyond a toolkit. it seems like the timing is opportune; currently, parties from academia and industry in denmark are starting collaboration. examples are recent, open-source models released by companies 18 and a large cross-collaboration on a large danish text corpus named gigaword by @xcite . to strengthen the community around danish nlp, the danlp project have gathered both companies in front of the field and researchers from danish universities (the danish technical university, the university of copenhagen, and the it university of copenhagen) for network meetings to discuss and collaborate on danish nlp 19 . one of the major identified challenges is how to gather and share data safely concerning privacy and gdpr. ## 7 concluding remarks danlp is a new toolkit to make danish nlp more applicable to industry. with this aim, the danlp project has been engaged in dialogues with industry, knowledge sharing and community building with academia and professionals. the hope is to continue working with a stronger community and inspire similar projects in other low to medium resource languages.