Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
iulusoy committed Nov 29, 2024
2 parents ac560de + 8057153 commit 4add286
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
rev: 0.8.1
hooks:
- id: nbstripout
files: ".ipynb"
Expand Down
4 changes: 2 additions & 2 deletions ammico/notebooks/DemoNotebook_ammico.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@
"source": [
"%pwd\n",
"image_dict = ammico.find_files(\n",
" path=\"data/errors_Nov24/Error1\",\n",
" # path=str(data_path),\n",
" # path = \"/content/drive/MyDrive/misinformation-data/\",\n",
" path=str(data_path),\n",
" limit=15,\n",
")"
]
Expand Down
9 changes: 9 additions & 0 deletions ammico/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,15 @@ def analyse_image(self) -> dict:
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:
Expand Down

0 comments on commit 4add286

Please sign in to comment.