-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ADD soundchoice-g2p #59
Comments
BERT Encoder
clean_pipelineは2つ以上の空白を1つの空白に変換し、大文字にする。
|
hidden_statesのshapeは(13, 1, 13, 768)になる。
下記のコードが不思議。
元コードだと、hidden_stateの末尾4つを参照する構造になっている。 |
論理としては、hidden_stateの末尾4つを加算した上で、Special Tokenを除いたEmbeddingだけ取得している。 |
expand_to_charsでは、入力されたテキストの文字列を、spaceに相当するトークンでword_boundariesを検出し、word単位のembeddingから、文字単位のembeddingに変換する。
|
To be or not to be, that is the questionary この場合、tokens_ids_wordは下記のようになる。 emb.shape (1, 12, 768) このデータに対して、expand_to_charsをすると、ワード数が一致しなくなる気がする。 |
元のコードは下記。numpyに移植した際に、token_ids_wordの定義が間違っている気がする。
|
"To be or not to be, that is the questionary"のように","が存在する場合、grapheme_pipelineで","が削除されるものの、BERTのTokenizerでは","を単語として扱うため、token_ids_wordの数と、expand_to_charsの中のseqを分割した数も合わなくなる。これも移植で入った問題かも。 |
|
expand_to_charsのvalueのdump。空白にはその次のwordのembeddingが入る。
しかし、下記のロジックが何をしているかわからない。
オリジナルのコードは下記。
|
word_boundaries[idx]を代入しているのは、空白部分には0を入れることを意図している。 |
attention
|
OriginalのSpechBrainでのテスト。
|
現状のシステムはPunctuationは扱えないので、事前に置換すべきように見える。 |
Issueに上げてみた。 |
推論の起点コード。
|
オリジナルのコードでも、emb.shapeが12になる。そもそも、元のコードの段階で、subword分割をうまく考慮できていない気がする。
|
Implement soundchoice-g2p ailia-models#1500
The text was updated successfully, but these errors were encountered: