diff --git a/Nepali_nlp/__init__.py b/Nepali_nlp/__init__.py
deleted file mode 100644
index 746febc..0000000
--- a/Nepali_nlp/__init__.py
+++ /dev/null
@@ -1,12 +0,0 @@
-from .Embedding import Embeddings
-from .synonym import Synonym
-from .spellcheck import Corrector
-from .summerization import Summerize
-from .unicode_nepali import Unicode
-from .preeti_unicode import preeti
-from .ocr import OCR
-from .Nepali_tokenizer import Tokenizer
-from .sentence_similar import Avg_vector_similar
-from .news_scrap import extract_news
-from .news_latest import UpdateNews
-from .stemmer import Stem
\ No newline at end of file
diff --git a/Nepali_nlp/news_latest.py b/Nepali_nlp/news_latest.py
deleted file mode 100644
index cbac0b8..0000000
--- a/Nepali_nlp/news_latest.py
+++ /dev/null
@@ -1,36 +0,0 @@
-import sys
-sys.path.append('..')
-
-from .utils import top_news_link
-from .news_scrap import extract_news
-from .summerization import Summerize
-
-
-class UpdateNews:
- def __init__(self):
- pass
-
- def show_latest(self, word_vec, portal='onlinekhabar', number_of_news=5):
- """his function returns tile of latest news, link for latest news and summerize news
-
- Keyword Arguments:
- portal {str} -- [news portal sites; for now either 'onlinekhabar' or 'ekantipur'] (default: {'onlinekhabar'})
- number_of_news {int} -- [Number of top trending news] (default: {5})
-
- Returns:
- [tuple] -- [tuple of (titles, links, news_summerises)]
- """
- assert portal in ['onlinekhabar', 'ekantipur'], "we currently support only ekantipur and onlinekhabar"
- extracted_link = top_news_link(portal=portal, top_n=number_of_news)
- summary_ = Summerize()
- links = []
- titles = []
- news_summerises = []
- for link in extracted_link:
- title, text = extract_news(link)
- summary_news = summary_.show_summary(word_vec, text, length_sentence_predict=7)
- links.append(link)
- titles.append(title)
- news_summerises.append(summary_news)
-
- return (titles, links, news_summerises)
diff --git a/Nepali_nlp/unicode_nepali.py b/Nepali_nlp/unicode_nepali.py
deleted file mode 100644
index 59488a9..0000000
--- a/Nepali_nlp/unicode_nepali.py
+++ /dev/null
@@ -1,86 +0,0 @@
-import sys
-sys.path.append('..')
-
-import collections
-from collections import OrderedDict
-from pprint import pprint
-
-from .local_dataset.unicode import nepali, halanta, sabda_banot, exception
-
-class Unicode:
- """This class converts Roman written Nepali word to actual Nepali word."""
- def __init__(self, *args, **kwargs):
- pass
-
- def unicode_word(self,text):
- """Function converts Unicode words(i.e Roman word like 'nepal') to actual Nepali word.
-
- Arguments:
- text {string} -- Unicode 'word' to convert
-
- Returns:
- [string] -- [Converted Nepali word.]
- """
- text = text.replace('aa','aaa') #To solve the common pattern Roman writing
- if text in exception.keys():
- return exception[text]
-
- combine_latter = {**nepali, **sabda_banot}
- latter_dict = OrderedDict(sorted(combine_latter.items(), key=lambda x: len(x[0]),reverse=True)) #We are going through reverse lenth of user input roman i.e first check 'kha' than check 'ka'
- split = [] #to automatically store the predicted possible words in roman from user input text.
- keys = list(latter_dict.keys())
- c = 0 #counter to get out of loop.
-
- while text != "":#until every word are not converted
- key_collection = keys.copy()
- #To split the text according to the mapping word list in key_collection.
- for key in key_collection:
- if key == text[:len(key)]:
- split.append(key)
- text = text[len(key):]
- c = 1
- break
-
- if c== 1:# to continue out of loop. It can be done by other ways too.
- c = 0
- continue
-
- if not text: #if text is empty, breaking the loop.
- break
-
- split.append(text[0])
- text = text[1:] #if nothing is found in text which can be mapped, we leave the initial latter.. we will be taking care about that soon.
-
- actual_text = ''
- #converting all the possible single syallabyal of roman to Nepali.
- for latter in split:
- if latter in nepali:
- actual_text = actual_text + str(nepali[latter])
- elif latter in sabda_banot:
- actual_text = actual_text + str(sabda_banot[latter])
-
- #Taking care of Khutta kateko character of Nepali.
- for index in range(len(split)):
- if split[index] in sabda_banot:
- if split[index-1] in halanta:
- split[index-1] = halanta[split[index-1]]
- continue
- else:
- if split[index-2] in halanta:
- split[index-2] = halanta[split[index-2]]
- continue
-
- #if khutta kateko appears in last character: Going to make a single character i.e r=>ra.
- if split[-1] in halanta:
- split[-1] = halanta[split[-1]]
-
- #Summing up everything.
- word = ''
- for item in split:
- try:
- word = word + str(latter_dict[item])
- except:
- word = word + ' '
-
- return word
-
diff --git a/README.md b/README.md
index aeb4ff0..f4405cd 100644
--- a/README.md
+++ b/README.md
@@ -25,6 +25,7 @@ Synonym().raw_synonym(word = 'माया',word_vec=word_vec) #method: 1
Synonym().filter_synonym(word = 'साथी',word_vec=word_vec) #method: 2
#output -> 'भाइहरू','सहपाठी','प्रेमी','दाइ','प्रेमि','बहिनी'
```
+
Word-spell corrector
```python
@@ -34,12 +35,14 @@ Corrector().corrector(word='सुशल') #In a very raw stage for now.
Corrector().spell_correct("कस्त भको हेरौ है")
#output-> "कस्तो भयो हेर है"
```
-Nepali text summerizer
+
+Nepali text Summarizer
```python
-from Nepali_nlp import Summerize
-Summerize().show_summary(word_vec,text, length_sentence_predict=5)
+from Nepali_nlp import Summarize
+Summarize().show_summary(word_vec,text, length_sentence_predict=5)
```
+
Nepali unicode to Devnagiri Font
```python
@@ -47,6 +50,7 @@ from Nepali_nlp import Unicode
text = 'ma ghara jaanchhu'
Unicode().unicode_word(text) #output-> 'म घर जान्छु'
```
+
Preeti-font character to Devnagiri Font
```python
@@ -54,12 +58,14 @@ from Nepali_nlp import preeti
unicode_word = 'g]kfnL'
print(preeti(unicode_word)) #output-> नेपाली
```
+
OCR(optical character reader)
```python
from Nepali_nlp import OCR
text = OCR(image_location)
```
+
Nepali Tokenizer
```python
@@ -94,22 +100,24 @@ from Nepali_nlp import extract_news
news_link = 'https://www.onlinekhabar.com/2019/12/821094'
title, news = extract_news(news_link) #onlinekhabar and ekantipur is supported at the moment.
```
+
Show latest news summary
```python
from Nepali_nlp import UpdateNews
-title, links, summerized_news = UpdateNews().show_latest(word_vec=word_vec,portal='onlinekhabar',number_of_news=5) #ekantipur portal is also supported
+title, links, Summarized_news = UpdateNews().show_latest(word_vec=word_vec,portal='onlinekhabar',number_of_news=5) #ekantipur portal is also supported
```
TODOs:
-- [x] Nepali Embeddings
-- [x] Tokenizers (sentence, word, character)
+
+- [x] Nepali Embeddings
+- [x] Tokenizers (sentence, word, character)
- [x] Stop Words
-- [x] Nepali Words Collection
+- [x] Nepali Words Collection
- [x] Nepali Word synonym
- [x] Roman Nepali to Nepali
- [x] Nepali OCR
-- [x] Summerization
+- [x] summarization
- [x] Pos_tag
- [x] Nepali stemming
- [x] Sentence similarity score
diff --git a/nepali_nlp/__init__.py b/nepali_nlp/__init__.py
new file mode 100644
index 0000000..8f53677
--- /dev/null
+++ b/nepali_nlp/__init__.py
@@ -0,0 +1,12 @@
+from nepali_nlp.embedding import Embeddings
+from nepali_nlp.synonym import Synonym
+from nepali_nlp.spellcheck import Corrector
+from nepali_nlp.summarization import Summarize
+from nepali_nlp.unicode_nepali import Unicode
+from nepali_nlp.preeti_unicode import preeti
+from nepali_nlp.ocr import OCR
+from nepali_nlp.nepali_tokenizer import Tokenizer
+from nepali_nlp.sentence_similar import Avg_vector_similar
+from nepali_nlp.news_scrap import extract_news
+from nepali_nlp.news_latest import UpdateNews
+from nepali_nlp.stemmer import Stem
diff --git a/Nepali_nlp/Download_embedding.py b/nepali_nlp/download_embedding.py
similarity index 100%
rename from Nepali_nlp/Download_embedding.py
rename to nepali_nlp/download_embedding.py
diff --git a/Nepali_nlp/Embedding.py b/nepali_nlp/embedding.py
similarity index 71%
rename from Nepali_nlp/Embedding.py
rename to nepali_nlp/embedding.py
index 0b2498f..867f754 100644
--- a/Nepali_nlp/Embedding.py
+++ b/nepali_nlp/embedding.py
@@ -1,10 +1,9 @@
+from nepali_nlp.download_embedding import Download
+from gensim.models.keyedvectors import KeyedVectors
+import gensim
import os
import sys
-sys.path.append('..')
-import gensim
-from gensim.models.keyedvectors import KeyedVectors
-from .Download_embedding import Download
class Embeddings:
"""This class helps to load embedding in keyedvector format."""
@@ -19,23 +18,26 @@ def load_large_vector(self):
[keyedVectors] -- [Custom Nepali word Embedding]
"""
download = Download()
- download.download_file_from_google_drive('1ik38vahOmzhiU2DBi78VOqDt7YFPsk5w', 'word_vector.sg')
- word_vector = KeyedVectors.load_word2vec_format('word_vector.sg', binary=False)
+ download.download_file_from_google_drive(
+ '1ik38vahOmzhiU2DBi78VOqDt7YFPsk5w', 'word_vector.sg')
+ word_vector = KeyedVectors.load_word2vec_format(
+ 'word_vector.sg', binary=False)
os.remove("word_vector.sg")
return word_vector
def load_vector(self):
"""Returns a large Nepali word embedding. Creator: https://github.com/rabindralamsal/Word2Vec-Embeddings-for-Nepali-Language
-
+
Returns:
[keyedVectors] -- [Custom Nepali word Embedding]
"""
download = Download()
- download.download_file_from_google_drive('1KnAZ2Eeqwz3S9VrAuzTLWysAaRB6Ch7e', 'nepali_embeddings_word2vec.txt')
+ download.download_file_from_google_drive(
+ '1KnAZ2Eeqwz3S9VrAuzTLWysAaRB6Ch7e', 'nepali_embeddings_word2vec.txt')
word_vector = KeyedVectors.load('nepali_embeddings_word2vec.txt')
os.remove("nepali_embeddings_word2vec.txt")
-
+
return word_vector
def __str__(self):
diff --git a/Nepali_nlp/fasttext_embedding.py b/nepali_nlp/fasttext_embedding.py
similarity index 100%
rename from Nepali_nlp/fasttext_embedding.py
rename to nepali_nlp/fasttext_embedding.py
diff --git a/nepali_nlp/local_dataset/__init__.py b/nepali_nlp/local_dataset/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/Nepali_nlp/local_dataset/eng_nep.txt b/nepali_nlp/local_dataset/eng_nep.txt
similarity index 100%
rename from Nepali_nlp/local_dataset/eng_nep.txt
rename to nepali_nlp/local_dataset/eng_nep.txt
diff --git a/Nepali_nlp/local_dataset/m_bpe.model b/nepali_nlp/local_dataset/m_bpe.model
similarity index 100%
rename from Nepali_nlp/local_dataset/m_bpe.model
rename to nepali_nlp/local_dataset/m_bpe.model
diff --git a/Nepali_nlp/local_dataset/m_bpe.vocab b/nepali_nlp/local_dataset/m_bpe.vocab
similarity index 100%
rename from Nepali_nlp/local_dataset/m_bpe.vocab
rename to nepali_nlp/local_dataset/m_bpe.vocab
diff --git a/Nepali_nlp/local_dataset/nep-eng (1).txt b/nepali_nlp/local_dataset/nep-eng (1).txt
similarity index 100%
rename from Nepali_nlp/local_dataset/nep-eng (1).txt
rename to nepali_nlp/local_dataset/nep-eng (1).txt
diff --git a/Nepali_nlp/local_dataset/nep.traineddata b/nepali_nlp/local_dataset/nep.traineddata
similarity index 100%
rename from Nepali_nlp/local_dataset/nep.traineddata
rename to nepali_nlp/local_dataset/nep.traineddata
diff --git a/Nepali_nlp/local_dataset/nepal_dict.txt b/nepali_nlp/local_dataset/nepal_dict.txt
similarity index 100%
rename from Nepali_nlp/local_dataset/nepal_dict.txt
rename to nepali_nlp/local_dataset/nepal_dict.txt
diff --git a/Nepali_nlp/local_dataset/spell_model.pkl b/nepali_nlp/local_dataset/spell_model.pkl
similarity index 100%
rename from Nepali_nlp/local_dataset/spell_model.pkl
rename to nepali_nlp/local_dataset/spell_model.pkl
diff --git a/Nepali_nlp/local_dataset/stopword1.txt b/nepali_nlp/local_dataset/stopword1.txt
similarity index 100%
rename from Nepali_nlp/local_dataset/stopword1.txt
rename to nepali_nlp/local_dataset/stopword1.txt
diff --git a/Nepali_nlp/local_dataset/translation.xlsx b/nepali_nlp/local_dataset/translation.xlsx
similarity index 100%
rename from Nepali_nlp/local_dataset/translation.xlsx
rename to nepali_nlp/local_dataset/translation.xlsx
diff --git a/Nepali_nlp/local_dataset/unicode.py b/nepali_nlp/local_dataset/unicode.py
similarity index 100%
rename from Nepali_nlp/local_dataset/unicode.py
rename to nepali_nlp/local_dataset/unicode.py
diff --git a/Nepali_nlp/local_dataset/words.txt b/nepali_nlp/local_dataset/words.txt
similarity index 100%
rename from Nepali_nlp/local_dataset/words.txt
rename to nepali_nlp/local_dataset/words.txt
diff --git a/Nepali_nlp/n_gram.py b/nepali_nlp/n_gram.py
similarity index 94%
rename from Nepali_nlp/n_gram.py
rename to nepali_nlp/n_gram.py
index 6b9e6b7..4b9fd6d 100644
--- a/Nepali_nlp/n_gram.py
+++ b/nepali_nlp/n_gram.py
@@ -1,7 +1,6 @@
+from nepali_nlp.nepali_tokenizer import Tokenizer
import sys
-sys.path.append('..')
-from .Nepali_tokenizer import Tokenizer
class NgramGenerator(Tokenizer):
@@ -10,11 +9,11 @@ def __init__(self, n_gram):
def generate_n_gram(self, token_text):
"""This function generate ngram token list
-
+
Arguments:
sentence {list} -- list of tokenized text
n_gram {int} -- value of n-gram
-
+
Returns:
list -- multi array list of n-gram tokenized words
"""
diff --git a/Nepali_nlp/Nepali_tokenizer.py b/nepali_nlp/nepali_tokenizer.py
similarity index 100%
rename from Nepali_nlp/Nepali_tokenizer.py
rename to nepali_nlp/nepali_tokenizer.py
diff --git a/nepali_nlp/news_latest.py b/nepali_nlp/news_latest.py
new file mode 100644
index 0000000..d022695
--- /dev/null
+++ b/nepali_nlp/news_latest.py
@@ -0,0 +1,36 @@
+from nepali_nlp.summarization import Summarize
+from nepali_nlp.news_scrap import extract_news
+from nepali_nlp.utils import top_news_link
+import sys
+
+
+class UpdateNews:
+ def __init__(self):
+ pass
+
+ def show_latest(self, word_vec, portal='onlinekhabar', number_of_news=5):
+ """This function returns tile of latest news, link for latest news and Summarize news
+
+ Keyword Arguments:
+ portal {str} -- [news portal sites; for now either 'onlinekhabar' or 'ekantipur'] (default: {'onlinekhabar'})
+ number_of_news {int} -- [Number of top trending news] (default: {5})
+
+ Returns:
+ [tuple] -- [tuple of (titles, links, news_summaries)]
+ """
+ assert portal in [
+ 'onlinekhabar', 'ekantipur'], "we currently support only ekantipur and onlinekhabar"
+ extracted_link = top_news_link(portal=portal, top_n=number_of_news)
+ summary_ = Summarize()
+ links = []
+ titles = []
+ news_summaries = []
+ for link in extracted_link:
+ title, text = extract_news(link)
+ summary_news = summary_.show_summary(
+ word_vec, text, length_sentence_predict=7)
+ links.append(link)
+ titles.append(title)
+ news_summaries.append(summary_news)
+
+ return (titles, links, news_summaries)
diff --git a/Nepali_nlp/news_scrap.py b/nepali_nlp/news_scrap.py
similarity index 91%
rename from Nepali_nlp/news_scrap.py
rename to nepali_nlp/news_scrap.py
index e441e3e..c8d006d 100644
--- a/Nepali_nlp/news_scrap.py
+++ b/nepali_nlp/news_scrap.py
@@ -1,20 +1,17 @@
-import sys
-sys.path.append('..')
-
-import re
-import urllib
-
-from bs4 import BeautifulSoup
-from urllib.request import Request, urlopen
from newsplease import NewsPlease
+from urllib.request import Request, urlopen
+from bs4 import BeautifulSoup
+import urllib
+import re
+import sys
def get_content_onlinekhabar(link):
"""This function extract the contants from onlinakhabar.com
-
+
Arguments:
link {string} -- [Link for onlinekhabar news]
-
+
Returns:
[string] -- [News content from the link]
"""
@@ -29,13 +26,13 @@ def get_content_onlinekhabar(link):
def get_content_ekantipur(link):
"""This function helps in extracting the news from ekantipur.com
-
+
Arguments:
link {string} -- [News link from ekantipur site.]
-
+
Raises:
ValueError: [If unable to extract news from given link]
-
+
Returns:
[string] -- [News content from the link]
"""
@@ -52,13 +49,13 @@ def get_content_ekantipur(link):
def extract_news(link):
"""This function extract news from given link.
-
+
Arguments:
link {string} -- [Link of news article.]
-
+
Raises:
ValueError: [Raise error if link is not for ekantipur/onlinekhabar]
-
+
Returns:
[tuple(title, sample_text)] -- [Title: Title of the news, sample_text: news article that has been extracted from the link given.]
"""
@@ -67,7 +64,8 @@ def extract_news(link):
elif 'ekantipur.com' in link:
sample_text = get_content_ekantipur(link)
else:
- raise ValueError('Currently we work with onlinekhabar and ekantipur only. Other sites will be addedd soon.')
+ raise ValueError(
+ 'Currently we work with onlinekhabar and ekantipur only. Other sites will be addedd soon.')
article = NewsPlease.from_url(link)
title = article.title
diff --git a/Nepali_nlp/ocr.py b/nepali_nlp/ocr.py
similarity index 66%
rename from Nepali_nlp/ocr.py
rename to nepali_nlp/ocr.py
index 777f724..9766555 100644
--- a/Nepali_nlp/ocr.py
+++ b/nepali_nlp/ocr.py
@@ -1,25 +1,24 @@
-import sys
-sys.path.append('..')
-
-from PIL import Image
-import pytesseract
-import cv2
import os
+import cv2
+import pytesseract
+from PIL import Image
+import sys
-def OCR(image,lang='nep', url_=False):
+def OCR(image, lang='nep', url_=False):
"""This function helps to generate text from image
-
+
Arguments:
image {string} -- [Location of image.]
-
+
Keyword Arguments:
lang {str} -- [language for OCR] (default: {'nep'})
-
+
Returns:
[string] -- [Text generated by OCR.]
"""
- assert lang in ['eng','nep'], 'specified language is not available at the moment'
+ assert lang in [
+ 'eng', 'nep'], 'specified language is not available at the moment'
if url_:
import urllib.request
@@ -29,12 +28,13 @@ def OCR(image,lang='nep', url_=False):
image = "temp.jpg"
- if lang=='nep':
+ if lang == 'nep':
tessdata_dir_config = r'--tessdata-dir "local_dataset"'
- text = pytesseract.image_to_string(image, lang=lang, config=tessdata_dir_config)
-
+ text = pytesseract.image_to_string(
+ image, lang=lang, config=tessdata_dir_config)
+
return text
image = cv2.imread(image)
image = cv2.cvtColor(image, cv2.COLOR_BRG2GRAY)
- text = pytesseract.image_to_string(image)#if 'eng' is the choice
- return text
\ No newline at end of file
+ text = pytesseract.image_to_string(image) # if 'eng' is the choice
+ return text
diff --git a/Nepali_nlp/positional_encoding.py b/nepali_nlp/positional_encoding.py
similarity index 78%
rename from Nepali_nlp/positional_encoding.py
rename to nepali_nlp/positional_encoding.py
index 6727798..f71ce85 100644
--- a/Nepali_nlp/positional_encoding.py
+++ b/nepali_nlp/positional_encoding.py
@@ -1,8 +1,7 @@
+from nepali_nlp.nepali_tokenizer import Tokenizer
+import numpy as np
import sys
-sys.path.append('..')
-import numpy as np
-from .Nepali_tokenizer import Tokenizer
class PositionalEncoding:
"""This class helps to encoding the tokenized text based on the postion of the word."""
@@ -10,12 +9,12 @@ class PositionalEncoding:
def __init__(self, vector_dim):
self.vector_dim = vector_dim
- def encode(self,token):
+ def encode(self, token):
"""This function generate the embedding of text based on postion
-
+
Arguments:
token {list} -- List of tokens of sentences
-
+
Returns:
2Darray {numpy.ndarray} -- 2D embedding for the tokens based on postions
@@ -26,20 +25,17 @@ def encode(self,token):
token_text = token.word_tokenize(test_data)
posencode = PositionalEncoding(10)
print(posencode.encode(token_text))
-
+
"""
-
- encoding_vector = np.zeros((len(token),self.vector_dim),dtype=float)
+
+ encoding_vector = np.zeros((len(token), self.vector_dim), dtype=float)
for row in range(len(token)):
- i=1
- for column in range(0,int(self.vector_dim),2):
- w = 1/(pow(1000,2*i/self.vector_dim))
+ i = 1
+ for column in range(0, int(self.vector_dim), 2):
+ w = 1/(pow(1000, 2*i/self.vector_dim))
encoding_vector[row][column] = np.sin(w*row)
encoding_vector[row][column+1] = np.cos(w*row)
# print(row,column,i,np.sin(w*(row+1)))
# print(row,column+1,i,np.cos(w*(row+1)))
- i+=1
+ i += 1
return encoding_vector
-
-
-
diff --git a/Nepali_nlp/preeti_unicode.py b/nepali_nlp/preeti_unicode.py
similarity index 100%
rename from Nepali_nlp/preeti_unicode.py
rename to nepali_nlp/preeti_unicode.py
diff --git a/Nepali_nlp/sentence_similar.py b/nepali_nlp/sentence_similar.py
similarity index 94%
rename from Nepali_nlp/sentence_similar.py
rename to nepali_nlp/sentence_similar.py
index f5d43b3..86acdbf 100644
--- a/Nepali_nlp/sentence_similar.py
+++ b/nepali_nlp/sentence_similar.py
@@ -2,8 +2,8 @@
from scipy import spatial
from gensim.utils import simple_preprocess
-from .Embedding import Embeddings
-from .Nepali_tokenizer import Tokenizer
+from nepali_nlp.embedding import Embeddings
+from nepali_nlp.nepali_tokenizer import Tokenizer
class Avg_vector_similar:
@@ -15,12 +15,12 @@ def tidy_sentence(self, sentence, vocabulary):
def compute_sentence_similarity(self, model, sent_1, sent_2):
""" Compute the average vector similarity
-
+
Args:
model : word2vec model
sent_1 (string): first sentence
sent_2 (string): second sentence
-
+
Returns:
int: similarity score
"""
@@ -33,11 +33,11 @@ def compute_sentence_similarity(self, model, sent_1, sent_2):
def jaccard_similar(self, sent1, sent2):
"""This function return similarity of two sentence based in jaccard similarity methods.
find more at https://arxiv.org/abs/1907.02251.
-
+
Arguments:
sent1 {string} -- [first sentence]
sent2 {string} -- [second sentence]
-
+
Returns:
[int] -- [Similarity score]
"""
@@ -47,11 +47,11 @@ def jaccard_similar(self, sent1, sent2):
def pair_similarity(self, word_vec, sentences):
"""compute similarity of two sentence using the mean of word's embedding
-
+
Args:
word_vec (Embedding): Word to vec embedding
sentences (string): sentences in Nepali
-
+
Returns:
int: similarity score between two sentences.
"""
diff --git a/Nepali_nlp/spellcheck.py b/nepali_nlp/spellcheck.py
similarity index 81%
rename from Nepali_nlp/spellcheck.py
rename to nepali_nlp/spellcheck.py
index 80dbe72..04faa21 100644
--- a/Nepali_nlp/spellcheck.py
+++ b/nepali_nlp/spellcheck.py
@@ -1,45 +1,47 @@
# coding: utf-8
-import os
-import sys
-sys.path.append('..')
+from difflib import get_close_matches
from spello.model import SpellCorrectionModel
+import os
+import sys
-from difflib import get_close_matches
class Corrector:
"""This function correct the Nepali word based on distance of character.
-
+
"""
+
def __init__(self):
self.this_dir, self.this_file = os.path.split(__file__)
- self.sp = SpellCorrectionModel(language='hi').load(os.path.join(self.this_dir, "local_dataset", "spell_model.pkl"))
+ self.sp = SpellCorrectionModel(language='hi').load(
+ os.path.join(self.this_dir, "local_dataset", "spell_model.pkl"))
- def __load_words(self,location):
+ def __load_words(self, location):
"""This function load all the Nepali words in given location.
-
+
Arguments:
location {string} -- [Location where vocabulary is located please be sure to indicate name and extension also.]
-
+
Returns:
[list] -- [List of all Nepali word]
"""
- file = open(os.path.join(self.this_dir,"local_dataset", location), 'r')
+ file = open(os.path.join(self.this_dir,
+ "local_dataset", location), 'r')
text = file.read()
text = text.split()
file.close()
return text
- def corrector(self,word,location ='words.txt',number=2, threshold = 0.3):
+ def corrector(self, word, location='words.txt', number=2, threshold=0.3):
"""This functon returns 'n' number of correct words.
-
+
Arguments:
word {string} -- [Word you want to check for spelling.]
-
+
Keyword Arguments:
location {str} -- [Location of Vocabulary file with name and extension.] (default: {'../local_dataset/words.txt'})
number {int} -- [Number of close correct words.] (default: {2})
threshold {float} -- [Threshold distance between words enter and predicted word'.] (default: {0.3})
-
+
Returns:
[list] -- ['n' correct word predictions.]
"""
@@ -59,4 +61,3 @@ def spell_correct(self, text):
Dict -- dictionary with correct word, input text and correction text.
"""
return self.sp.spell_correct(text)
-
diff --git a/Nepali_nlp/stemmer.py b/nepali_nlp/stemmer.py
similarity index 93%
rename from Nepali_nlp/stemmer.py
rename to nepali_nlp/stemmer.py
index 86fbc95..c60ceac 100644
--- a/Nepali_nlp/stemmer.py
+++ b/nepali_nlp/stemmer.py
@@ -1,12 +1,14 @@
import snowballstemmer
+
class Stem:
"""Stem the words to its root eg 'गरेका' to 'गर'.
Credit: https://github.com/snowballstem/snowball
"""
+
def __init__(self) -> None:
self.stemmer = snowballstemmer.NepaliStemmer()
-
+
def rootify(self, text):
"""Generates the stem words for input text.
@@ -18,6 +20,5 @@ def rootify(self, text):
"""
if isinstance(text, str):
return self.stemmer.stemWords(text.split())
-
+
return self.stemmer.stemWords(text)
-
\ No newline at end of file
diff --git a/Nepali_nlp/stopword.py b/nepali_nlp/stopword.py
similarity index 74%
rename from Nepali_nlp/stopword.py
rename to nepali_nlp/stopword.py
index fd94bae..3e696aa 100644
--- a/Nepali_nlp/stopword.py
+++ b/nepali_nlp/stopword.py
@@ -1,34 +1,30 @@
-import sys
-sys.path.append('..')
-
+from nepali_nlp.nepali_tokenizer import Tokenizer
import ast
-from .Nepali_tokenizer import Tokenizer
+import sys
class Stopwords:
"""This class helps in removing Nepali stopwords."""
+
def __init__(self):
pass
- def remove_stopwords(self,text):
+ def remove_stopwords(self, text):
"""This function remove stopwords from text
-
+
Arguments:
sentence {string} -- sentence you want to remove stopwords
Returns:
list -- token words
"""
- f = open("local_dataset/stopword1.txt",'r')
+ f = open("local_dataset/stopword1.txt", 'r')
stopwords = f.read()
stopwords = ast.literal_eval(stopwords)
tokenizer = Tokenizer()
token = tokenizer.word_tokenize(text)
- word_without_stopword=[]
+ word_without_stopword = []
for word in token:
if word not in stopwords:
word_without_stopword.append(word)
-
- return word_without_stopword
-
-
+ return word_without_stopword
diff --git a/Nepali_nlp/summerization.py b/nepali_nlp/summarization.py
similarity index 76%
rename from Nepali_nlp/summerization.py
rename to nepali_nlp/summarization.py
index 9771e81..b9f60b0 100644
--- a/Nepali_nlp/summerization.py
+++ b/nepali_nlp/summarization.py
@@ -1,11 +1,11 @@
+import string
+import numpy as np
+from sklearn.feature_extraction.text import TfidfVectorizer
+from nepali_nlp.embedding import Embeddings
import sys
-sys.path.append('..')
-from .Embedding import Embeddings
-from sklearn.feature_extraction.text import TfidfVectorizer
-import numpy as np
-import string
-class Summerize:
+
+class Summarize:
def __init__(self, *args, **kwargs):
# This should not be the standard way of doing. Standard way will be done in next iteration.
# print('Loading Embedding')
@@ -14,25 +14,26 @@ def __init__(self, *args, **kwargs):
# print('Embedding is now loaded')
pass
- def preprocess(self,text):
+ def preprocess(self, text):
"""This function remove punctuation and split text in sentences.
-
+
Arguments:
text {String} -- [Nepali text paragraph]
-
+
Returns:
[list] -- [list of sentences]
"""
sentences = text.split(u"।")
- sentences = [sentence.translate(str.maketrans('', '', string.punctuation)) for sentence in sentences]
+ sentences = [sentence.translate(str.maketrans(
+ '', '', string.punctuation)) for sentence in sentences]
return sentences
-
- def generate_centroif_tfidf(self,word_vec,sentence):
+
+ def generate_centroif_tfidf(self, word_vec, sentence):
"""This function generates tfidf value for each sentences
-
+
Arguments:
sentence {[list]} -- [list of sentence in paragraph]
-
+
Returns:
[array] -- [mathmatical representation for centroid]
"""
@@ -48,13 +49,13 @@ def generate_centroif_tfidf(self,word_vec,sentence):
res = [word_vec[term] for term in similar_term]
return sum(res)/len(res)
- def sentence_vectorizer(self,word_vec,sentence,size):
+ def sentence_vectorizer(self, word_vec, sentence, size):
"""This function vectorize the passed sentence for the given size
-
+
Arguments:
sentence {list} -- [list of sentence in Nepali text paragraph]
size {int/tuple} -- [size of word embedding vector]
-
+
Returns:
[dictionary] -- [vectorize value for every sentence]
"""
@@ -65,23 +66,24 @@ def sentence_vectorizer(self,word_vec,sentence,size):
sentence_word = sentence[i].split()
except:
pass
- sentence = [word for word in sentence_word if word in word_vec.vocab]
+ sentence = [
+ word for word in sentence_word if word in word_vec.vocab]
if sentence:
for word in sentence:
word_vec_ = word_vec[word]
sum_vec = np.add(sum_vec, word_vec_)
-
+
dic[i] = sum_vec/len(sentence)
return dic
- def sentence_selection(self,centroid, sentences_dict, summary_length):
+ def sentence_selection(self, centroid, sentences_dict, summary_length):
"""This function helps to select the most important sentece.
-
+
Arguments:
centroid {array} -- [tf/idf values of centroid]
sentences_dict {array} -- [Vectorized value of every sentence]
- summary_length {int/float} -- [Number of summerized sentence desired.]
-
+ summary_length {int/float} -- [Number of Summarized sentence desired.]
+
Returns:
[list] -- [list of sentence id selected.]
"""
@@ -108,7 +110,7 @@ def sentence_selection(self,centroid, sentences_dict, summary_length):
new_vector = sentences_dict[sentence_id]
sent_char_num = len(sentence_retriever[sentence_id])
redundancy = [sentences_dict[k] for k in sentence_ids
- if (1 - cosine(new_vector, sentences_dict[k]) > 0.95)]
+ if (1 - cosine(new_vector, sentences_dict[k]) > 0.95)]
if not redundancy:
summary_char_num += sent_char_num
@@ -117,37 +119,36 @@ def sentence_selection(self,centroid, sentences_dict, summary_length):
if summary_char_num > limit:
stop = True
- else:
+ else:
sentences_number = int(summary_length)
sentence_ids = rank[:sentences_number]
sentence_ids = map(lambda t: t[0], sentence_ids)
sentence_ids = sorted(sentence_ids)
-
+
return sentence_ids
- def combine_sentence(self,centroid_tfidf,sent,sent_dict,length):
- """This function helps to combine summerized sentence.
-
+ def combine_sentence(self, centroid_tfidf, sent, sent_dict, length):
+ """This function helps to combine Summarized sentence.
+
Arguments:
centroid_tfidf {array} -- [vectorized value of centroid.]
sent {list} -- [list of sentence in text]
sent_dict {dictionary} -- [Vectorized value of every sentence.]
length {int/float} -- [Number of desired sentence.]
-
+
Returns:
- [string] -- [Paragraph of combine summerize sentence.]
+ [string] -- [Paragraph of combine Summarize sentence.]
"""
- ids = self.sentence_selection(centroid_tfidf,sent_dict,length)
+ ids = self.sentence_selection(centroid_tfidf, sent_dict, length)
whole_summary = []
for inde in ids:
whole_summary.append(sent[inde])
return '।'.join(whole_summary)
-
- def show_summary(self, word_vec,sample_text,length_sentence_predict):
+ def show_summary(self, word_vec, sample_text, length_sentence_predict):
sent = self.preprocess(sample_text)
- centroid_tfidf = self.generate_centroif_tfidf(word_vec,sent)
+ centroid_tfidf = self.generate_centroif_tfidf(word_vec, sent)
size = word_vec.vector_size
- sent_dict = self.sentence_vectorizer(word_vec,sent,size)
- return self.combine_sentence(centroid_tfidf,sent,sent_dict,length_sentence_predict)
\ No newline at end of file
+ sent_dict = self.sentence_vectorizer(word_vec, sent, size)
+ return self.combine_sentence(centroid_tfidf, sent, sent_dict, length_sentence_predict)
diff --git a/Nepali_nlp/synonym.py b/nepali_nlp/synonym.py
similarity index 80%
rename from Nepali_nlp/synonym.py
rename to nepali_nlp/synonym.py
index 07aee7d..db2f298 100644
--- a/Nepali_nlp/synonym.py
+++ b/nepali_nlp/synonym.py
@@ -1,34 +1,32 @@
+from nepali_nlp.embedding import Embeddings
import sys
-sys.path.append('..')
-from .Embedding import Embeddings
class Synonym:
-
+
def __init__(self):
pass
- def raw_synonym(self,word, word_vec):
+ def raw_synonym(self, word, word_vec):
"""show the similar words according to embedding
-
+
Arguments:
word{string} -- word you want to find synonym
-
+
Returns:
[tuple]: synonym word with similarity score
"""
-
+
synonyms = word_vec.most_similar(word)
return synonyms
-
- def filter_synonym(self,word, word_vec):
+ def filter_synonym(self, word, word_vec):
"""Funtion to filter the similarity words from embedding
-
+
Arguments:
word {string} -- [word to find similar words]
-
+
Returns:
[list] -- [similar words]
"""
@@ -37,7 +35,7 @@ def filter_synonym(self,word, word_vec):
for words in synonyms:
if word not in words[0]:
syno.append(words)
-
+
return syno
def __str__(self):
diff --git a/nepali_nlp/unicode_nepali.py b/nepali_nlp/unicode_nepali.py
new file mode 100644
index 0000000..2773ef6
--- /dev/null
+++ b/nepali_nlp/unicode_nepali.py
@@ -0,0 +1,89 @@
+from nepali_nlp.local_dataset.unicode import nepali, halanta, sabda_banot, exception
+from pprint import pprint
+from collections import OrderedDict
+import collections
+import sys
+
+
+class Unicode:
+ """This class converts Roman written Nepali word to actual Nepali word."""
+
+ def __init__(self, *args, **kwargs):
+ pass
+
+ def unicode_word(self, text):
+ """Function converts Unicode words(i.e Roman word like 'nepal') to actual Nepali word.
+
+ Arguments:
+ text {string} -- Unicode 'word' to convert
+
+ Returns:
+ [string] -- [Converted Nepali word.]
+ """
+ text = text.replace(
+ 'aa', 'aaa') # To solve the common pattern Roman writing
+ if text in exception.keys():
+ return exception[text]
+
+ combine_latter = {**nepali, **sabda_banot}
+ # We are going through reverse lenth of user input roman i.e first check 'kha' than check 'ka'
+ latter_dict = OrderedDict(
+ sorted(combine_latter.items(), key=lambda x: len(x[0]), reverse=True))
+ # to automatically store the predicted possible words in roman from user input text.
+ split = []
+ keys = list(latter_dict.keys())
+ c = 0 # counter to get out of loop.
+
+ while text != "": # until every word are not converted
+ key_collection = keys.copy()
+ # To split the text according to the mapping word list in key_collection.
+ for key in key_collection:
+ if key == text[:len(key)]:
+ split.append(key)
+ text = text[len(key):]
+ c = 1
+ break
+
+ if c == 1: # to continue out of loop. It can be done by other ways too.
+ c = 0
+ continue
+
+ if not text: # if text is empty, breaking the loop.
+ break
+
+ split.append(text[0])
+ # if nothing is found in text which can be mapped, we leave the initial latter.. we will be taking care about that soon.
+ text = text[1:]
+
+ actual_text = ''
+ # converting all the possible single syallabyal of roman to Nepali.
+ for latter in split:
+ if latter in nepali:
+ actual_text = actual_text + str(nepali[latter])
+ elif latter in sabda_banot:
+ actual_text = actual_text + str(sabda_banot[latter])
+
+ # Taking care of Khutta kateko character of Nepali.
+ for index in range(len(split)):
+ if split[index] in sabda_banot:
+ if split[index-1] in halanta:
+ split[index-1] = halanta[split[index-1]]
+ continue
+ else:
+ if split[index-2] in halanta:
+ split[index-2] = halanta[split[index-2]]
+ continue
+
+ # if khutta kateko appears in last character: Going to make a single character i.e r=>ra.
+ if split[-1] in halanta:
+ split[-1] = halanta[split[-1]]
+
+ # Summing up everything.
+ word = ''
+ for item in split:
+ try:
+ word = word + str(latter_dict[item])
+ except:
+ word = word + ' '
+
+ return word
diff --git a/Nepali_nlp/utils.py b/nepali_nlp/utils.py
similarity index 100%
rename from Nepali_nlp/utils.py
rename to nepali_nlp/utils.py
diff --git a/overview_of_library.ipynb b/overview_of_library.ipynb
index ed84747..8316807 100644
--- a/overview_of_library.ipynb
+++ b/overview_of_library.ipynb
@@ -375,8 +375,8 @@
}
},
"source": [
- "from summerization import Summerize\n",
- "summer = Summerize()\n",
+ "from summarization import Summarize\n",
+ "summer = Summarize()\n",
"summer.show_summary(word_vec,text, length_sentence_predict=7)"
],
"execution_count": 10,
@@ -436,10 +436,10 @@
}
},
"source": [
- "#lets summerize news\n",
- "summery_news = Summerize().show_summary(word_vec,news, length_sentence_predict=5)\n",
+ "#lets Summarize news\n",
+ "summery_news = Summarize().show_summary(word_vec,news, length_sentence_predict=5)\n",
"print('Title:',title)\n",
- "print('summerize_news:',summery_news)"
+ "print('Summarize_news:',summery_news)"
],
"execution_count": 12,
"outputs": [
@@ -447,7 +447,7 @@
"output_type": "stream",
"text": [
"Title: लिम्पियाधुरा समेटेर नयाँ नक्सा तयार गर्दै नापी विभाग\n",
- "summerize_news: कूटनीतिक नोटको जवाफ नआइरहेका बेला प्रधानमन्त्री केपी शर्मा ओलीले सीमा समस्या लगायतका विषयमा छलफल गर्न पूर्वप्रधानमन्त्री एवं नेकपा बरिष्ठ नेता माधवकुमार नेपाललाई विशेष दूतका रुपमा भारत पठाउन लागेको विषय चर्चामा अयो । तर यसको स्वतन्त्र पुष्टि सरकारका प्रतिनिधिले गरेका छैनन् । प्रधानमन्त्रीका परराष्ट्र सल्लाहकार राजन भट्टराई भन्छन् ‘विशेष दूत भनेर पठाइसकेपछि सबैको जानकारीमा आइहाल्छ । अहिलेलाई यस विषयमा सार्वजनिक रुपमा बोल्ने गरी केही भएको छैन ।’\n"
+ "Summarize_news: कूटनीतिक नोटको जवाफ नआइरहेका बेला प्रधानमन्त्री केपी शर्मा ओलीले सीमा समस्या लगायतका विषयमा छलफल गर्न पूर्वप्रधानमन्त्री एवं नेकपा बरिष्ठ नेता माधवकुमार नेपाललाई विशेष दूतका रुपमा भारत पठाउन लागेको विषय चर्चामा अयो । तर यसको स्वतन्त्र पुष्टि सरकारका प्रतिनिधिले गरेका छैनन् । प्रधानमन्त्रीका परराष्ट्र सल्लाहकार राजन भट्टराई भन्छन् ‘विशेष दूत भनेर पठाइसकेपछि सबैको जानकारीमा आइहाल्छ । अहिलेलाई यस विषयमा सार्वजनिक रुपमा बोल्ने गरी केही भएको छैन ।’\n"
],
"name": "stdout"
}
@@ -463,7 +463,7 @@
"source": [
"#why bother copying news link\n",
"from news_latest import UpdateNews\n",
- "title, links, summerized_news = UpdateNews().show_latest(word_vec=word_vec,portal='onlinekhabar',number_of_news=5) #ekantipur portal is also supported"
+ "title, links, Summarized_news = UpdateNews().show_latest(word_vec=word_vec,portal='onlinekhabar',number_of_news=5) #ekantipur portal is also supported"
],
"execution_count": 0,
"outputs": []
@@ -482,7 +482,7 @@
"source": [
"print('latest news title:', title)\n",
"print('links for latest news:',links)\n",
- "print('summerized latest news:',summerized_news)"
+ "print('Summarized latest news:',Summarized_news)"
],
"execution_count": 14,
"outputs": [
@@ -491,7 +491,7 @@
"text": [
"latest news title: ['ठोकेर भन्छु, नेकपा यसरी चल्दैन', 'कलंकीमा डरलाग्दो दुर्घटना, ब्रेकफेल भएको ट्रकले दर्जन सवारीलाई ठक्कर दियो', 'माधवलाई ‘जालसाजी’को जनाउ, वामदेवको आफ्नै मस्यौदा !', 'ओली-यती प्रेम : अढाइ लाखको उडान, ३२ हजारको केक !', 'मुद्दामै नछिरी उम्किए ओली, कार्यकर्तामा भरेनन् ऊर्जा']\n",
"links for latest news: ['https://www.onlinekhabar.com/2020/02/839335', 'https://www.onlinekhabar.com/2020/02/839351', 'https://www.onlinekhabar.com/2020/02/839345', 'https://www.onlinekhabar.com/2020/02/839356', 'https://www.onlinekhabar.com/2020/02/839361']\n",
- "summerized latest news: [' नेकपा संसदीय दलका उपनेता सुवासचन्द्र नेम्वाङ सोमबार बिहान ११ बजे माधवकुमार नेपालकहाँ पुगे । पार्टी भन्दा देश र जनता ठूलो हो । यही मान्यताका साथ म अगाडि बढिरहेको छु । र अहिले जुन प्रशंग आएको छ यो प्रशंग पार्टीभित्र निर्णय भएको भन्ने छैन । मलाई विश्वास छ पार्टीले त्यसरी निर्णय गरेको छैन । त्यसैले पार्टी विचार पुर्\\u200dयाएर साँच्चिकै संविधान संशोधन गर्नुपर्\\u200dयो भने आवश्यकता र औचित्य स्थापित हुने गरेर पारदर्शिताका आधारमा पार्टी अगाडि बढ्छ भन्ने मलाई विश्वास छ ।', ' त्यसपछि अनियन्त्रित बनेको ट्रकले ट्याक्सी कार जिप मोटरसाइकलसहित एक दर्जन सवारी साधनलाई ठक्कर दिएको कालिमाटी वृत्तका डीएसपी रुगम कुँवरले जानकारी दिए । दुर्घटनामा चितवनका ३३ वर्षका सम्शेर गरुङको मृत्यु भएको छ । ट्रक र स्कर्पिओले चेपिएर उनको मृत्यु भएको बताइएको छ । ८ जना घाइते भएका छन् । उनीहरु मध्ये ७ जनाको शहीद मेमोरियल र एक जनाको ट्रमा सेन्टरमा उपचार भइरहेको छ । ट्रक चालक सर्लाही बरहथवाका वीरेन्द्रकुमार शाहलाई नियन्त्रणमा लिइएको प्रहरीले जनाएको छ ।', ' आफ्नो एउटा नेताका लागि संविधान नै संशोधन गर्न तयार हुने पार्टीले जनताका एजेण्डा सुन्नुपर्दैन संविधानसभाबाट जारी भएको संविधान आवधिक निर्वाचनबाट बहुमत प्राप्त पार्टीको गुट व्यवस्थापन र दाउपेचको शिकार बनाउन खोजिनु निन्दनीयमात्र होइन दीर्घकालीनरुपमा घातक पनि छ । किनकि संविधान संशोधनको माग गर्ने समुदाय सुशुप्त भएको मात्र हो एजेण्डा छाडेको छैन । मधेसवादी दलको राजनीति गर्ने मुख्य एजेण्डा अहिले पनि संविधान संशोधन नै हो । अब उनीहरुले एउटा व्यक्तिका लागि संशोधन गर्न तयार हुन्छौ भने समुदायको लागि किन नहुने भन्ने प्रश्न उठाउनेछन् । आफ्नै जिउमा काउसो दल्न तयार भएको नेकपा नेतृत्वले कार्यदल गठनको स्वामित्वबाट भाग्न खोजे पनि त्यो सुवास नेम्वाङ र खिमलाल देवकोटाकै भाषामा अर्को जालसाजी काम हो । बरु यो निर्णयबाट पछि हटेर जनतालाई बेलैमा प्रष्ट भाषामा बुझाउनु सचिवालयका नेताहरुको बुद्धिमता हुनेछ ।', ' अख्तियार दुरुपयोग अनुसन्धान आयोगका पूर्वप्रमुख आयुक्त सूर्यनाथ उपाध्याय प्रधानमन्त्रीले विवादित ब्यापारिक समूहको केकले आफ्नो जन्मोत्सव मनाउनुले जनतामा शंका बढाएको बताउँछन् । ‘अब त प्रधानमन्त्रीले नै जनतालाई कुरा यसो हो है भनेर जवाफ दिनुपर्छ’ उपाध्याय भन्छन् ‘उठेको शंका निवारण गर्ने काम उहाँकै हो ।’ कुवाका भ्यागुताले विरोध गरे थापा प्रधानमन्त्रीका प्रेस सल्लाहकार सूर्य थापा भने तेह्रथुमबासी प्रधानमन्त्रीका परिवार र शुभचिन्तकहरुले प्रेमपूर्वक केक प्रस्तुत गर्दा कुवाका भ्याकुताहरुले विरोध गरेको बताउँछन् ।\\n‘देशको प्रधानमन्त्रीको जन्मदिन मनाउने कार्यक्रममा जो पनि पुग्न सक्छ त्यहाँ यती समूह जान नहुने भन्ने छैन’ थापा भन्छन् ‘संसार नदेखेका कुवाका भ्यागुताहरुले यसको विरोध गरेका हुन् ।’ प्रधानमन्त्रीले उद्घाटन गरेको खानेपानी आयोजना लगायतलाई छायाँमा पार्न केकको विरोध भएको थापाले बताए । ‘यत्रो जन्मोत्सवमा राज्यको ढुकुटीबाट एक रुपैयाँ खर्च भएको छैन’ थापा भने ‘जनस्तरबाट भएको कार्यक्रमको विरोध गर्न केही मिडिया हात धोएर लागेका छन् ।’', ' यस्तो अवस्थामा पनि उहाँले प्रशिक्षित गर्नुभएको छ ।’ प्रधानमन्त्री ओलीले कम्युनिस्ट आचरण र पुष्पलाल एवं मदन भण्डारीले मार्गनिर्देश गरेको बाटोमै हिँडेको मात्र बताएनन् सुशासन र विकासको जग बसाल्ने काम पनि यो सरकारले गरेको समेत बताए । तर ओलीले न मुख्यमन्त्रीले उठाएको सवालतिर इंगित गरे न त कार्यकर्ताको मनमा उठेका जिज्ञासाको समाधान नै गरे । ओलीले सरकारले राम्रो काम गरेको र विरोधीहरू आत्तिएको विषयलाई नै बढी जोड दिए । कोही पनि गरिबीका कारण शीतलहल र चिसोका कारण कोही मर्नु नपर्ने काठमाडौं सडक मानवमुक्त बनेको फलाम खानी सञ्चालन गर्न लागेको हिमाली च्यांग्राबाट फाइदा लिन सकिने नेपाल सरकारले रेल ल्याउन लागेको जस्ता पुरानै विषयहरु प्रधानमन्त्रीले दोहोर्\\u200dयाए । सोमबार प्रशिक्षण कार्यक्रम राखेको नेकपा गण्डकीले मंगलबार र बुधबार बैठक बसेर समसामयिक विषयमा छलफल एवं कार्यकर्ताबीच अन्तक्रिर्या गर्ने कार्यसूची तय गरेको छ ।']\n"
+ "Summarized latest news: [' नेकपा संसदीय दलका उपनेता सुवासचन्द्र नेम्वाङ सोमबार बिहान ११ बजे माधवकुमार नेपालकहाँ पुगे । पार्टी भन्दा देश र जनता ठूलो हो । यही मान्यताका साथ म अगाडि बढिरहेको छु । र अहिले जुन प्रशंग आएको छ यो प्रशंग पार्टीभित्र निर्णय भएको भन्ने छैन । मलाई विश्वास छ पार्टीले त्यसरी निर्णय गरेको छैन । त्यसैले पार्टी विचार पुर्\\u200dयाएर साँच्चिकै संविधान संशोधन गर्नुपर्\\u200dयो भने आवश्यकता र औचित्य स्थापित हुने गरेर पारदर्शिताका आधारमा पार्टी अगाडि बढ्छ भन्ने मलाई विश्वास छ ।', ' त्यसपछि अनियन्त्रित बनेको ट्रकले ट्याक्सी कार जिप मोटरसाइकलसहित एक दर्जन सवारी साधनलाई ठक्कर दिएको कालिमाटी वृत्तका डीएसपी रुगम कुँवरले जानकारी दिए । दुर्घटनामा चितवनका ३३ वर्षका सम्शेर गरुङको मृत्यु भएको छ । ट्रक र स्कर्पिओले चेपिएर उनको मृत्यु भएको बताइएको छ । ८ जना घाइते भएका छन् । उनीहरु मध्ये ७ जनाको शहीद मेमोरियल र एक जनाको ट्रमा सेन्टरमा उपचार भइरहेको छ । ट्रक चालक सर्लाही बरहथवाका वीरेन्द्रकुमार शाहलाई नियन्त्रणमा लिइएको प्रहरीले जनाएको छ ।', ' आफ्नो एउटा नेताका लागि संविधान नै संशोधन गर्न तयार हुने पार्टीले जनताका एजेण्डा सुन्नुपर्दैन संविधानसभाबाट जारी भएको संविधान आवधिक निर्वाचनबाट बहुमत प्राप्त पार्टीको गुट व्यवस्थापन र दाउपेचको शिकार बनाउन खोजिनु निन्दनीयमात्र होइन दीर्घकालीनरुपमा घातक पनि छ । किनकि संविधान संशोधनको माग गर्ने समुदाय सुशुप्त भएको मात्र हो एजेण्डा छाडेको छैन । मधेसवादी दलको राजनीति गर्ने मुख्य एजेण्डा अहिले पनि संविधान संशोधन नै हो । अब उनीहरुले एउटा व्यक्तिका लागि संशोधन गर्न तयार हुन्छौ भने समुदायको लागि किन नहुने भन्ने प्रश्न उठाउनेछन् । आफ्नै जिउमा काउसो दल्न तयार भएको नेकपा नेतृत्वले कार्यदल गठनको स्वामित्वबाट भाग्न खोजे पनि त्यो सुवास नेम्वाङ र खिमलाल देवकोटाकै भाषामा अर्को जालसाजी काम हो । बरु यो निर्णयबाट पछि हटेर जनतालाई बेलैमा प्रष्ट भाषामा बुझाउनु सचिवालयका नेताहरुको बुद्धिमता हुनेछ ।', ' अख्तियार दुरुपयोग अनुसन्धान आयोगका पूर्वप्रमुख आयुक्त सूर्यनाथ उपाध्याय प्रधानमन्त्रीले विवादित ब्यापारिक समूहको केकले आफ्नो जन्मोत्सव मनाउनुले जनतामा शंका बढाएको बताउँछन् । ‘अब त प्रधानमन्त्रीले नै जनतालाई कुरा यसो हो है भनेर जवाफ दिनुपर्छ’ उपाध्याय भन्छन् ‘उठेको शंका निवारण गर्ने काम उहाँकै हो ।’ कुवाका भ्यागुताले विरोध गरे थापा प्रधानमन्त्रीका प्रेस सल्लाहकार सूर्य थापा भने तेह्रथुमबासी प्रधानमन्त्रीका परिवार र शुभचिन्तकहरुले प्रेमपूर्वक केक प्रस्तुत गर्दा कुवाका भ्याकुताहरुले विरोध गरेको बताउँछन् ।\\n‘देशको प्रधानमन्त्रीको जन्मदिन मनाउने कार्यक्रममा जो पनि पुग्न सक्छ त्यहाँ यती समूह जान नहुने भन्ने छैन’ थापा भन्छन् ‘संसार नदेखेका कुवाका भ्यागुताहरुले यसको विरोध गरेका हुन् ।’ प्रधानमन्त्रीले उद्घाटन गरेको खानेपानी आयोजना लगायतलाई छायाँमा पार्न केकको विरोध भएको थापाले बताए । ‘यत्रो जन्मोत्सवमा राज्यको ढुकुटीबाट एक रुपैयाँ खर्च भएको छैन’ थापा भने ‘जनस्तरबाट भएको कार्यक्रमको विरोध गर्न केही मिडिया हात धोएर लागेका छन् ।’', ' यस्तो अवस्थामा पनि उहाँले प्रशिक्षित गर्नुभएको छ ।’ प्रधानमन्त्री ओलीले कम्युनिस्ट आचरण र पुष्पलाल एवं मदन भण्डारीले मार्गनिर्देश गरेको बाटोमै हिँडेको मात्र बताएनन् सुशासन र विकासको जग बसाल्ने काम पनि यो सरकारले गरेको समेत बताए । तर ओलीले न मुख्यमन्त्रीले उठाएको सवालतिर इंगित गरे न त कार्यकर्ताको मनमा उठेका जिज्ञासाको समाधान नै गरे । ओलीले सरकारले राम्रो काम गरेको र विरोधीहरू आत्तिएको विषयलाई नै बढी जोड दिए । कोही पनि गरिबीका कारण शीतलहल र चिसोका कारण कोही मर्नु नपर्ने काठमाडौं सडक मानवमुक्त बनेको फलाम खानी सञ्चालन गर्न लागेको हिमाली च्यांग्राबाट फाइदा लिन सकिने नेपाल सरकारले रेल ल्याउन लागेको जस्ता पुरानै विषयहरु प्रधानमन्त्रीले दोहोर्\\u200dयाए । सोमबार प्रशिक्षण कार्यक्रम राखेको नेकपा गण्डकीले मंगलबार र बुधबार बैठक बसेर समसामयिक विषयमा छलफल एवं कार्यकर्ताबीच अन्तक्रिर्या गर्ने कार्यसूची तय गरेको छ ।']\n"
],
"name": "stdout"
}