-1
লোকাল ট্রেন পরিষেবা চালু করার জন্য দীর্ঘদিন ধরেই সরব হয়েছেন বহু নেতা নেত্রী।

How can I remove the "|" sign from the Bangla Sentence? and then tokenize it?

in this format "নেত্রী" instead of "নেত্রী।"

I am using python language.

Dharman
  • 26,923
  • 21
  • 73
  • 125

1 Answers1

0

To remove the ending "।", you can use string .replace() method: sentence.replace('।', '').

To tokenize the sentence, there are many libraries available, you can use any of inltk, indicnlp, stanfordnlp, bnlp. Here's a complete example using bnlp:

from bnlp import NLTKTokenizer

bnltk = NLTKTokenizer()

sentence = "লোকাল ট্রেন পরিষেবা চালু করার জন্য দীর্ঘদিন ধরেই সরব হয়েছেন বহু নেতা নেত্রী।"
sentence = sentence.replace('।', '') // remove ending "।"
word_tokens = bnltk.word_tokenize(sentence)

1-2-3-4
  • 637
  • 9
  • 19