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
  • 30,962
  • 25
  • 85
  • 135
NobinPegasus
  • 545
  • 2
  • 16

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)

let me down slowly
  • 822
  • 10
  • 27