mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-09-26 13:30:04 +00:00
Fix fasttext for multiline posts
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
80dbbd5501
commit
17d885fed8
1 changed files with 1 additions and 1 deletions
|
@ -25,7 +25,7 @@ defmodule Pleroma.Language.LanguageDetector.Fasttext do
|
|||
def detect(text) do
|
||||
text_path = Path.join(System.tmp_dir!(), "fasttext-#{Ecto.UUID.generate()}")
|
||||
|
||||
File.write(text_path, text)
|
||||
File.write(text_path, text |> String.replace(~r/\s+/, " "))
|
||||
|
||||
detected_language =
|
||||
case System.cmd("fasttext", ["predict", get_model(), text_path]) do
|
||||
|
|
Loading…
Reference in a new issue