зеркало из
https://github.com/ssciwr/AMMICO.git
synced 2025-10-30 05:26:05 +02:00
fix missing whitespace for links and names (#225)
* fix missing whitespace for links and names * remove comments in notebook * cleanup
Этот коммит содержится в:
родитель
dc6c904ec8
Коммит
8057153e60
@ -172,7 +172,7 @@
|
|||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"image_dict = ammico.find_files(\n",
|
"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",
|
" path=str(data_path),\n",
|
||||||
" limit=15,\n",
|
" limit=15,\n",
|
||||||
")"
|
")"
|
||||||
|
|||||||
@ -237,6 +237,15 @@ class TextDetector(AnalysisMethod):
|
|||||||
if not self.subdict["text"]:
|
if not self.subdict["text"]:
|
||||||
print("No text found - skipping analysis.")
|
print("No text found - skipping analysis.")
|
||||||
else:
|
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.translate_text()
|
||||||
self.remove_linebreaks()
|
self.remove_linebreaks()
|
||||||
if self.analyse_text:
|
if self.analyse_text:
|
||||||
|
|||||||
Загрузка…
x
Ссылка в новой задаче
Block a user