fix missing whitespace for links and names (#225)

* fix missing whitespace for links and names

* remove comments in notebook

* cleanup
Этот коммит содержится в:
Inga Ulusoy 2024-11-22 20:03:00 +01:00 коммит произвёл GitHub
родитель dc6c904ec8
Коммит 8057153e60
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
2 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@ -172,7 +172,7 @@
"outputs": [],
"source": [
"image_dict = ammico.find_files(\n",
" # path=\"/content/drive/MyDrive/misinformation-data/\",\n",
" # path = \"/content/drive/MyDrive/misinformation-data/\",\n",
" path=str(data_path),\n",
" limit=15,\n",
")"

Просмотреть файл

@ -237,6 +237,15 @@ class TextDetector(AnalysisMethod):
if not self.subdict["text"]:
print("No text found - skipping analysis.")
else:
# make sure all full stops are followed by whitespace
# otherwise googletrans breaks
index_stop = self.subdict["text"].find(".")
if self.subdict["text"][index_stop + 1] != " ":
self.subdict["text"] = (
self.subdict["text"][: index_stop + 1]
+ " "
+ self.subdict["text"][index_stop + 1 :]
)
self.translate_text()
self.remove_linebreaks()
if self.analyse_text: