arxiv.submission.services.classifier.classifier module
Classifier service integration.
-
class
arxiv.submission.services.classifier.classifier.
Classifier
(verify=True, headers={})[source]
Bases: arxiv.integration.api.service.HTTPIntegration
Represents an interface to the classifier service.
-
ClassifierResponse
alias of typing.Tuple
-
class
Meta
[source]
Bases: object
Configuration for Classifier
.
-
service_name
= 'classifier'
-
SERVICE
= 'classic'
-
VERSION
= '0.0'
-
classify
(timeout=1.0)[source]
Make a classification request to the classifier service.
- Parameters
content (bytes) – Raw text content from an e-print.
- Return type
Tuple
[List
[Suggestion
], List
[Flag
], Optional
[Counts
]]
- Returns
list – A list of classifications.
list – A list of QA flags.
Counts
or None – Feature counts, if provided.
-
is_available
()[source]
Check our connection to the classifier service.
- Return type
bool
-
classmethod
probability
(logodds)[source]
Convert log odds to a probability.
- Return type
float
-
class
arxiv.submission.services.classifier.classifier.
Counts
[source]
Bases: tuple
Various counts of paper content.
-
chars
Alias for field number 0
-
pages
Alias for field number 1
-
stops
Alias for field number 2
-
words
Alias for field number 3
-
class
arxiv.submission.services.classifier.classifier.
Flag
[source]
Bases: tuple
General-purpose QA flag.
-
key
Alias for field number 0
-
value
Alias for field number 1
-
class
arxiv.submission.services.classifier.classifier.
Suggestion
[source]
Bases: tuple
A category suggested by the classifier.
-
category
Alias for field number 0
-
probability
Alias for field number 1