n-gram単語を指定すると、「start to end」と「end to start」から連続する部分文字列パターンを取得したいと考えています。Pythonで連続した部分文字列を取得する
例えば、4グラムの場合、computer supported machine translation
は次の部分文字列を取得する必要があります。開始するには端からcomputer supported
、computer supported machine
- 3グラム
natural language processing
ためmachine translation
、supported machine translation
、私はnatural language
とlanguage processing
を取得する必要があります。
私は本当に大きなnグラムを持っていますので、これを行う最も簡単な方法を知りたいと思っています!
を使用することができ、リストになりたくない場合。 – Galen