candidates = candidates if isinstance(candidates, list) else [candidates]
for candidate in candidates:
args = tuple([m.context for m in candidate.get_mentions()])
if not (isinstance(args[0], TemporarySpanMention)):
raise ValueError(
f"Accepts Span-type arguments, {type(candidate)}-type found."
)
After Change
candidates = candidates if isinstance(candidates, list) else [candidates]
for candidate in candidates:
args = tuple([m.context for m in candidate.get_mentions()])
if any(not (isinstance(arg, TemporarySpanMention)) for arg in args):
raise ValueError(
f"Visual feature only accepts Span-type arguments, "
f"{type(candidate)}-type found."