Skip to content

Commit

Permalink
mix format
Browse files Browse the repository at this point in the history
  • Loading branch information
cocoa-xu committed Jan 24, 2024
1 parent d4f9450 commit bca53f8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/tflite_elixir/high-level-api/mobile_bert.ex
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ defmodule TFLiteElixir.MobileBert do
content_words = String.split(content)

content_tokens = Enum.map(content_words, &FullTokenizer.tokenize(&1, true, vocab_map))

content_token_idx_to_word_idx_mapping =
for {token, i} <- Enum.with_index(content_tokens), reduce: [] do
acc ->
Expand Down Expand Up @@ -196,7 +197,7 @@ defmodule TFLiteElixir.MobileBert do

defp excerpt_words(content_data, start_idx, end_idx) do
pattern =
Enum.slice(content_data.content_words, start_idx..end_idx-1)
Enum.slice(content_data.content_words, start_idx..(end_idx - 1))
|> Enum.map(&Regex.escape/1)
|> Enum.join("\\s+")

Expand Down

0 comments on commit bca53f8

Please sign in to comment.