Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfixes #47

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions evaluation/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
'scipy',
'networkx',
'blanc',
'scikit-learn',
'wmd',
],
entry_points={
'console_scripts': [
Expand Down
6 changes: 4 additions & 2 deletions evaluation/summ_eval/data_stats_metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
from collections import Counter
from multiprocessing import Pool
import gin
import logging
import spacy
from summ_eval.data_stats_utils import Fragments
from summ_eval.metric import Metric

logger = logging.getLogger(__name__)

try:
_en = spacy.load('en_core_web_sm')
except OSError:
print('Downloading the spacy en_core_web_sm model\n'
"(don't worry, this will only happen once)", file=stderr)
logger.info("Downloading the spacy en_core_web_sm model\n (don't worry, this will only happen once)")
from spacy.cli import download
download('en_core_web_sm')
_en = spacy.load('en_core_web_sm')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(self, model_name_or_path: str = None, modules: Iterable[nn.Module]


if not os.listdir(model_path):
if model_url[-1] is "/":
if model_url[-1] == "/":
model_url = model_url[:-1]
logging.info("Downloading sentence transformer model from {} and saving it at {}".format(model_url, model_path))
try:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
import torch
from sentence_transformers.losses import BatchHardTripletLoss
from summ_eval.sentence_transformers.losses import BatchHardTripletLoss

# Test-suite from https://github.com/omoindrot/tensorflow-triplet-loss/blob/master/model/tests/test_triplet_loss.py
# Skipped the `test_gradients_pairwise_distances()` test since it's trivial to see if your model loss turns NaN
Expand Down