orkgnlp.annotation.csner.annotator.CSNer

class CSNer(*args, **kwargs)[source]

Bases: ORKGNLPBaseService

The CSNer requires abstracts and titles models and their configurations obtained during the training. The required files are downloaded while initiation, if it has not happened before.

You can pass the parameter force_download=True to remove and re-download the previous downloaded service files.

Parameters
  • service – Service name.

  • force_download – Indicates whether the required files are to be downloaded again. Defaults to False.

  • batch_size – Size of the batches used during model prediction. This argument is used by services that applies batch evaluation. Defaults to 16.

Methods

release_memory

Releases the memory of all available executors.

Attributes

SERVICE_NAME

__call__(title=None, abstract=None)[source]

Applies Named Entity Recognition on the given paper’s title and/or abstract.

Parameters
  • title (Optional[str]) – Paper’s title.

  • abstract (Optional[str]) – Paper’s abstract.

Return type

Any

Returns

If both are given, a dict representing the annotated parts for each of the given title and abstract. Otherwise, a list of the annotated parts for the given text is returned.

Raises

orkgnlp.common.util.exceptions.ORKGNLPValidationError – If neither of the parameters is given.

release_memory()

Releases the memory of all available executors.