
# adaptation of mT5-multilingual-XLSum for Nepali Lnaguage

This repository contains adapted version of mT5-multilinguag-XLSum for Single Language (Nepali). View original [mT5-multilinguag-XLSum model](https://huggingface.co/csebuetnlp/mT5_multilingual_XLSum)

## Using this model in `transformers` (tested on 4.11.0.dev0)

```python
import re
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM

article_text = " तीन नगरपालिकालाई समेटेर भेरी किनारमा बन्न थालेको आधुनिक नमुना सहरको काम तीव्र गतिमा अघि बढेको छ । भेरीगंगा, गुर्भाकोट र लेकबेंसी नगरपालिकामा बन्न थालेको भेरीगंगा उपत्यका नमुना आधुनिक सहर निर्माण हुन लागेको हो । यसले नदी वारि र पारिको ४ सय ६० वर्ग किलोमिटर क्षेत्रलाई समेट्नेछ ।"

model_name = "Anjaan-Khadka/summarization_nepali"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)

input_ids = tokenizer(
    (article_text),
    return_tensors="pt",
    padding="max_length",
    truncation=True,
    max_length=512
)["input_ids"]

output_ids = model.generate(
    input_ids=input_ids,
    max_length=84,
    no_repeat_ngram_size=2,
    num_beams=4
)[0]

summary = tokenizer.decode(
    output_ids,
    skip_special_tokens=True,
    clean_up_tokenization_spaces=False
)

print(summary)

```
{"language": ["ne"], "tags": ["summarization", "mT5"], "datasets": ["csebuetnlp/xlsum"], "widget": [{"text": "\u0924\u0940\u0928 \u0928\u0917\u0930\u092a\u093e\u0932\u093f\u0915\u093e\u0932\u093e\u0908 \u0938\u092e\u0947\u091f\u0947\u0930 \u092d\u0947\u0930\u0940 \u0915\u093f\u0928\u093e\u0930\u092e\u093e \u092c\u0928\u094d\u0928 \u0925\u093e\u0932\u0947\u0915\u094b \u0906\u0927\u0941\u0928\u093f\u0915 \u0928\u092e\u0941\u0928\u093e \u0938\u0939\u0930\u0915\u094b \u0915\u093e\u092e \u0924\u0940\u0935\u094d\u0930 \u0917\u0924\u093f\u092e\u093e \u0905\u0918\u093f \u092c\u0922\u0947\u0915\u094b \u091b\u202f\u0964 \u092d\u0947\u0930\u0940\u0917\u0902\u0917\u093e, \u0917\u0941\u0930\u094d\u092d\u093e\u0915\u094b\u091f \u0930 \u0932\u0947\u0915\u092c\u0947\u0902\u0938\u0940 \u0928\u0917\u0930\u092a\u093e\u0932\u093f\u0915\u093e\u092e\u093e \u092c\u0928\u094d\u0928 \u0925\u093e\u0932\u0947\u0915\u094b \u092d\u0947\u0930\u0940\u0917\u0902\u0917\u093e \u0909\u092a\u0924\u094d\u092f\u0915\u093e \u0928\u092e\u0941\u0928\u093e \u0906\u0927\u0941\u0928\u093f\u0915 \u0938\u0939\u0930 \u0928\u093f\u0930\u094d\u092e\u093e\u0923 \u0939\u0941\u0928 \u0932\u093e\u0917\u0947\u0915\u094b \u0939\u094b\u202f\u0964 \u092f\u0938\u0932\u0947 \u0928\u0926\u0940 \u0935\u093e\u0930\u093f \u0930 \u092a\u093e\u0930\u093f\u0915\u094b \u096a \u0938\u092f \u096c\u0966 \u0935\u0930\u094d\u0917 \u0915\u093f\u0932\u094b\u092e\u093f\u091f\u0930 \u0915\u094d\u0937\u0947\u0924\u094d\u0930\u0932\u093e\u0908 \u0938\u092e\u0947\u091f\u094d\u0928\u0947\u091b\u202f\u0964"}], "model-index": [{"name": "Anjaan-Khadka/summarization_nepali", "results": [{"task": {"type": "summarization", "name": "Summarization"}, "dataset": {"name": "xsum", "type": "xsum", "config": "default", "split": "test"}, "metrics": [{"type": "rouge", "value": 36.5002, "name": "ROUGE-1", "verified": false}]}]}]}
transformers pytorch mt5 text2text-generation summarization mT5 ne dataset:csebuetnlp/xlsum model-index autotrain_compatible endpoints_compatible text-generation-inference region:us
TAGS
#transformers #pytorch #mt5 #text2text-generation #summarization #mT5 #ne #dataset-csebuetnlp/xlsum #model-index #autotrain_compatible #endpoints_compatible #text-generation-inference #region-us 


# adaptation of mT5-multilingual-XLSum for Nepali Lnaguage

This repository contains adapted version of mT5-multilinguag-XLSum for Single Language (Nepali). View original mT5-multilinguag-XLSum model

## Using this model in 'transformers' (tested on 4.11.0.dev0)


# adaptation of mT5-multilingual-XLSum for Nepali Lnaguage

This repository contains adapted version of mT5-multilinguag-XLSum for Single Language (Nepali). View original mT5-multilinguag-XLSum model ## Using this model in 'transformers' (tested on 4.11.0.dev0)
TAGS
#transformers #pytorch #mt5 #text2text-generation #summarization #mT5 #ne #dataset-csebuetnlp/xlsum #model-index #autotrain_compatible #endpoints_compatible #text-generation-inference #region-us 
 # adaptation of mT5-multilingual-XLSum for Nepali Lnaguage

This repository contains adapted version of mT5-multilinguag-XLSum for Single Language (Nepali). View original mT5-multilinguag-XLSum model ## Using this model in 'transformers' (tested on 4.11.0.dev0)
TAGS
#transformers #pytorch #mt5 #text2text-generation #summarization #mT5 #ne #dataset-csebuetnlp/xlsum #model-index #autotrain_compatible #endpoints_compatible #text-generation-inference #region-us 
# adaptation of mT5-multilingual-XLSum for Nepali Lnaguage

This repository contains adapted version of mT5-multilinguag-XLSum for Single Language (Nepali). View original mT5-multilinguag-XLSum model## Using this model in 'transformers' (tested on 4.11.0.dev0)