--- language: fa tags: - persian - RoBERTa license: apache-2.0 pipeline_tag: fill-mask mask_token: '[MASK]' widget: - text: 'در همین لحظه که شما مشغول [MASK] این متن هستید، میلیونها دیتا در فضای آنلاین در حال تولید است. ما در لایف وب به جمعآوری، پردازش و تحلیل این کلان داده (Big Data) میپردازیم.' extra_gated_prompt: "This MODEL IS NOT FREE, please enter your contact informations. We will reach you out" extra_gated_fields: contact information: text ---
# Lifeweb
### Tehran Language Model Welcome to Tehran, the repository for Lifeweb's language model. First versions of our models are all trained on our own dataset called **Divan** with more than **164 million documents** and more than **10B tokens** which is normalized and deduplicated meticulously to ensure its enrichment and comprehensiveness. A better dataset leads to a better model! # Use Model You can easily access the models using the sample code provided in the below. ```python from transformers import AutoTokenizer, AutoModelForMaskedLM, FillMaskPipeline # v1.0 model_name = "lifeweb-ai/tehran" tokenizer = AutoTokenizer.from_pretrained(model_name) model = AutoModelForMaskedLM.from_pretrained(model_name) text = "در همین لحظه که شما مشغول خواندن این متن هستید، میلیونها دیتا در فضای آنلاین در حال تولید است. ما در لایف وب به جمعآوری، پردازش و تحلیل این کلان داده (Big Data) میپردازیم." print(tokenizer.tokenize(text)) # ['در', 'همین', 'لحظه', 'که', 'شما', 'مشغول', 'خواندن', 'این', 'متن', 'هستید،', 'میلیون', '[zwnj]', 'ها', 'دیتا', 'در', 'فضای', 'انلاین', 'در', 'حال', 'تولید', 'است', '.', 'ما', 'در', 'لایف', 'وب', 'به', 'جمع', '[zwnj]', 'اوری', '##،', 'پردازش', 'و', 'تحلیل', 'این', 'کلان', 'داده', '(', 'big', 'data', ')', 'می', '[zwnj]', 'پردازیم', '.', '.'] # fill mask task text = "در همین لحظه که شما مشغول [MASK] این متن هستید، میلیونها دیتا در فضای آنلاین در حال تولید است. ما در لایف وب به جمعآوری، پردازش و تحلیل این کلان داده (Big Data) میپردازیم." classifier = FillMaskPipeline(model=model, tokenizer=tokenizer) result = classifier(text) print(result[0]) #{'score': 0.3825972378253937, 'token': 5764, 'token_str': 'خواندن', 'sequence': 'در همین لحظه که شما مشغول خواندن این متن هستید، میلیون ها دیتا در فضای انلاین در حال تولید است. ما در لایف وب به جمع اوری، پردازش و تحلیل این کلان داده ( big data ) می پردازیم.'} ``` # Results The **Tehran** is evaluated on three downstream NLP tasks comprising **NER**, **Sentiment Analysis**, and **Emotion Detection**. **Tehran** outperforms every other Persian language model in terms of accuracy and macro F1. Obvious from the table below, you can find the colab codes for each task to use as a tutorial besides the macro F1 score.These Colab codes are run equally on 4x2080 TI graphic cards.