Our paper can be found here: https://arxiv.org/abs/2405.07778
In this project, we aim at building a comprehensive word embedding [1] repository for the Turkish language. Using each of the state-of-the-art word embedding methods, embeddings of all the words in the language will be formed using a corpus. First, the three commonly-used embedding methods (Word2Vec [2]-[3] , Glove [4], Fasttext [5]) will be used and an embedding dictionary for each one will be formed. Then we will continue with context-dependent embedding methods such as BERT [6] and Elmo [7]. Each method will be applied with varying parameters such as different corpora and different embedding dimensions. The methods will be evaluated on analogy and similarity tasks.
git clone <url> <path>
python -m venv env # Create a virtual environment called env
pip install -r requirements.txt
.py
scripts or .ipynb
notebooks following the instructions. For details, please refer to our wiki.Dataset | Category | # Instances |
---|---|---|
Dataset by Güngör et al. [12] | Syntactic Analogy | 29,364 |
Dataset by Kurt [13] | Semantic Analogy | 3,296 |
WordSimTr [14] | Syntactic Similarity | 140 |
AnlamVer [15] | Semantic Similarity | 500 |
Task | Dataset | Train (# sentences) | Test (# sentences) |
---|---|---|---|
Sentiment analysis | Turkish Movie Dataset [16] | 16,100 | 4,144 |
Sentiment analysis | Turkish Sentiment Analysis Dataset [17] | 286,854 | 32,873 |
Sentiment analysis | Turkish Twitter Dataset [18] | 1,055 | 476 |
Named entity recognition | Turkish National Newspapers with NER labels [19] | 28,468 | 2,915 |
PoS tagging | UD BOUN Treebank [20] | 8,782 | 979 |
Within the context of intrinsic evaluation, the employed datasets have been compiled and made accessible herein, with the aim of facilitating reproducibility and enabling their integration into further investigations by researchers. With regard to the dataset presented by Güngör et al., we partitioned it into designated subcategories and subsequently arranged and preserved these divisions within this repository. Similarity scores in WordSimTr are normalized to a numeric scale ranging from 0 to 10 for compatibility with other similarity pairs.
gensim==4.3.1
ipykernel==6.22.0
(for Jupyter notebooks - alternatively, you can use .py
scripts)py7zr==0.20.5
(for preprocessing)pandas==2.0.0
(only for visualization of results)matplotlib==3.7.1
(only for visualization of results)tensorflow==2.10
(only for Word2Vec TensorFlow implementation)elmoformanylangs==0.0.4
(only for Elmo)
overrides==3.1.0
if you face any problem with elmoformanylangs
. Refer to the related issue.-hs 196
). Results provided in our paper are averaged results over these runs with Wilson Confidence Intervals.One of our key findings suggests that the word embeddings acquired from the contextual word embedding algorithm Bert outperform the traditional static word embedding models in the majority of both intrinsic and extrinsic evaluation tasks. You can download the X2Static Turkish Bert word embeddings from the following link: https://huggingface.co/CahidArda/bert-turkish-x2static/tree/main
We kindly request you to cite the corresponding paper if you use our results/trained models/benchmark scripts in your work.
@article{SARITAS2024124123,
title = {A comprehensive analysis of static word embeddings for Turkish},
journal = {Expert Systems with Applications},
volume = {252},
pages = {124123},
year = {2024},
issn = {0957-4174},
doi = {https://doi.org/10.1016/j.eswa.2024.124123},
url = {https://www.sciencedirect.com/science/article/pii/S0957417424009898},
author = {Karahan Sarıtaş and Cahid Arda Öz and Tunga Güngör},
keywords = {Static word embeddings, Contextual word embeddings, Embedding models, Turkish},
abstract = {Word embeddings are fixed-length, dense and distributed word representations that are used in natural language processing (NLP) applications. There are basically two types of word embedding models which are non-contextual (static) models and contextual models. The former method generates a single embedding for a word regardless of its context, while the latter method produces distinct embeddings for a word based on the specific contexts in which it appears. There are plenty of works that compare contextual and non-contextual embedding models within their respective groups in different languages. However, the number of studies that compare the models in these two groups with each other is very few and there is no such study in Turkish. This process necessitates converting contextual embeddings into static embeddings. In this paper, we compare and evaluate the performance of several contextual and non-contextual models in both intrinsic and extrinsic evaluation settings for Turkish. We make a fine-grained comparison by analyzing the syntactic and semantic capabilities of the models separately. The results of the analyses provide insights about the suitability of different embedding models in different types of NLP tasks. We also build a Turkish word embedding repository comprising the embedding models used in this work, which may serve as a valuable resource for researchers and practitioners in the field of Turkish NLP. We make the word embeddings, scripts, and evaluation datasets publicly available.}
}