{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/contextual-string-embeddings-for-sequence","title":"Contextual String Embeddings for Sequence Labeling","arxiv_id":null,"date":"2018-08-01","proceeding":"COLING 2018 8","authors":["Alan Akbik","Duncan Blythe","Rol Vollgraf",""],"abstract":"Recent advances in language modeling using recurrent neural networks have made it viable to model language as distributions over characters. By learning to predict the next character on the basis of previous characters, such models have been shown to automatically internalize linguistic concepts such as words, sentences, subclauses and even sentiment. In this paper, we propose to leverage the internal states of a trained character language model to produce a novel type of word embedding which we refer to as contextual string embeddings. Our proposed embeddings have the distinct properties that they (a) are trained without any explicit notion of words and thus fundamentally model words as sequences of characters, and (b) are contextualized by their surrounding text, meaning that the same word will have different embeddings depending on its contextual use. We conduct a comparative evaluation against previous embeddings and find that our embeddings are highly useful for downstream tasks: across four classic sequence labeling tasks we consistently outperform the previous state-of-the-art. In particular, we significantly outperform previous work on English and German named entity recognition (NER), allowing us to report new state-of-the-art F1-scores on the CoNLL03 shared task. We release all code and pre-trained language models in a simple-to-use framework to the research community, to enable reproduction of these experiments and application of our proposed embeddings to other tasks: https://github.com/zalandoresearch/flair","url_abs":"https://aclanthology.org/C18-1139","url_pdf":"https://aclanthology.org/C18-1139.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"contextual-string-embeddings-for-sequence","repo_url":"https://github.com/zalandoresearch/flair","is_official":0,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"NOASSERTION"}}],"tasks":[{"task_slug":"chunking","task_name":"Chunking"},{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"named-entity-recognition-1","task_name":"Named Entity Recognition"},{"task_slug":"named-entity-recognition-ner","task_name":"Named Entity Recognition (NER)"},{"task_slug":"part-of-speech-tagging","task_name":"Part-Of-Speech Tagging"},{"task_slug":"word-embeddings","task_name":"Word Embeddings"},{"task_slug":"named-entity-recognition","task_name":"named-entity-recognition"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/chunking-on-conll-2000","task":"Chunking","dataset":"CoNLL 2000","model":"Flair","rank_in_archive_order":6,"of":9,"metrics":{"Exact Span F1":"96.72"},"uses_additional_data":true},{"leaderboard":"/sota/chunking-on-penn-treebank","task":"Chunking","dataset":"Penn Treebank","model":"Flair embeddings","rank_in_archive_order":2,"of":8,"metrics":{"F1 score":"96.72"},"uses_additional_data":false},{"leaderboard":"/sota/named-entity-recognition-ner-on-conll-2003","task":"Named Entity Recognition (NER)","dataset":"CoNLL 2003 (English)","model":"Flair embeddings","rank_in_archive_order":30,"of":73,"metrics":{"F1":"93.09"},"uses_additional_data":true},{"leaderboard":"/sota/named-entity-recognition-on-conll-2003-german-1","task":"Named Entity Recognition (NER)","dataset":"CoNLL 2003 (German) Revised","model":"Flair","rank_in_archive_order":5,"of":5,"metrics":{"F1":"88.3"},"uses_additional_data":false},{"leaderboard":"/sota/part-of-speech-tagging-on-penn-treebank","task":"Part-Of-Speech Tagging","dataset":"Penn Treebank","model":"Flair embeddings","rank_in_archive_order":3,"of":20,"metrics":{"Accuracy":"97.85"},"uses_additional_data":false}],"syntology":{"atlas_url":null,"mcp":null,"developers":"https://syntology.ai/developers"},"arxiv_metadata":null,"syntology_extracted_results":null}