Contents
The default SuperTagging settings are:
SUPERTAGGING_SETTINGS = {
'ENABLED': False,
'DEBUG': False,
'WATCHED_FIELDS': {},
'AUTO_PROCESS': False,
'ONLY_NON_TAGGED_OBJECTS': False,
'CONTENTTYPE_NAME_MAPPING': {},
'INCLUDE_DISPLAY_FIELDS': True,
'REGISTER_MODELS': True,
'REMOVE_REL_ON_DISABLE': True,
'RESOLVE_PROPERTY_KEYS': True,
'SUBSTITUTE_TAG_UPDATE': True,
'USE_QUEUE': False,
'FILE_STORAGE': 'django.core.files.storage.FileSystemStorage',
'EXCLUSIONS': {
'MIN_RELEVANCE': 0,
'REL_TYPE_EXCLUSIONS': [],
'TAG_TYPE_EXCLUSIONS': [],
'TAG_TYPE_QUERY_EXCLUSIONS': []},
'FREEBASE': {
'DESCRIPTION_URL': 'http://www.freebase.com/api/trans/raw',
'ENABLED': False,
'RETRIEVE_DESCRIPTIONS': False,
'TYPE_MAPPINGS': {}},
'MARKUP': {
'CONTENT_CACHE_TIMEOUT': 3600,
'ENABLED': False,
'EXCLUDE': [],
'FIELD_SUFFIX': 'tagged',
'MIN_RELEVANCE': 0},
'OPEN_CALAIS': {
'API_KEY': '',
'DEFAULT_PROCESS_TYPE': 'TEXT/RAW',
'PROCESSING_DIRECTIVES': {
'calculateRelevanceScore': True,
'contentType': 'TEXT/RAW',
'docRDFaccessible': True,
'enableMetadataType': '',
'outputFormat': 'application/json',
'reltagBaseURL': ''},
'PROCESS_RELATIONS': True,
'PROCESS_SOCIALTAGS': True,
'PROCESS_TOPICS': True,
'USER_DIRECTIVES': {
'allowDistribution': False,
'allowSearch': False,
'externalID': '',
'submitter': 'python-calais client v.1.5'}},
}
Default: False
Whether or not SuperTagging is enabled. Will not process any objects if False. This allows starting and stopping tag processing while preserving the value of AUTO_PROCESS.
Default: {}
This settings is a dictionary that specifies all the models, fields and options.
The keys of the dictionary are strings in the format app_name.model_name. The value of each key is a dictionary, where the fields and other options are specified.
Here is a complete example:
SUPERTAGGING_MODULES = {
'stories.story': {
'fields': [{
'name': 'body',
'process_type': 'TEXT/HTML',
'markup': True
}, {
'name': 'tease'
}, {
'name': 'kicker',
'markup': True
}],
'match_kwargs': {
'status__in': [1,2,3,],
'published_date__isnull': False},
'date_field': 'published_date'
},
'media.image': {
'fields': [{'name': 'caption',
'process_type': 'TEXT/HTML',
'markup': True}],
'date_field': 'creation_date'
}
}
Default: True
Should SuperTagging include three extra fields for display purposes:
Default: False
If True, will set up post_save and post_delete signals to process the data.
Default: False
Used with AUTO_PROCESS. If True, will only process objects that have not been tagged before. Objects that have tags but need re-processing must be added to the queue manually.
If False, process all objects.
Default: True
If True, SuperTagging will try resolve the Calais ID to a tag name.
Default: False
If True, an additional attribute will be avilable in a model’s instance for easy query related access to SuperTagging.
Default: False
When True, and a substitute is specified in SuperTag all associated SuperTaggedItem and SuperTagRelation will be updated with the new tag.
Default: False
If True, all content related to a tag is removed (items from models SuperTaggedItem and SuperTaggedRelationItem.
Default: settings.DEFAULT_FILE_STORAGE
Default file storage used for the icon display field.
Default: False
If True, use the queuing system. When a object is saved, it will be saved to a queue for later processing. A management command is included for you to process the queue.
If False, process the object on save.
Default: {}
A dict of mapped content type ids to names, used for the views
{
34: 'stories',
83: 'images',
}
Where the key is the content type id and the value is the string used in the url:
This:
/supertagging/tag/barack_obama/stories/
/supertagging/tag/barack_obama/images/
instead of this:
/supertagging/tag/barack_obama/34/
/supertagging/tag/barack_obama/83/
This was done in order to make readable urls.
Default: TEXT/RAW
Tells the default process type for OpenCalais to process the data.
There are four options that can be supplied.
- TEXT/RAW
- TEXT/HTML
- TEXT/HTMLRAW
- TEXT/XML
Default:
{
"allowDistribution": False,
"allowSearch": False,
"externalID": '',
"submitter": "python-calais client v.1.5",
}
View Input Parameters on OpenCalais.com for more information.
Default:
{
"contentType": "TEXT/RAW",
"outputFormat": "application/json",
"reltagBaseURL": '',
"calculateRelevanceScore": True,
"enableMetadataType": '',
"docRDFaccessible": True,
}
View Input Parameters on OpenCalais.com for more information.
Default: False
If True, save the tag relations (Events/Facts) returned by OpenCalais
Default: False
If True, save the topics returned by OpenCalais. These will simply be added as tags, but will not include all tag details.
Default: False
If True, save the social tags returned by OpenCalais. These will simply be added as tags, but will not include all tag details.
Default: []
Tag types as strings to exclude from being added. These tags should be all the “Entities” listed on the following link.
Default: []
Same as above but these are the relations and are shown on the following link as “Events and Facts”
NOT IMPLEMENTED (YET)
Tags will be saved, but not returned in the queries
Default: 0
Integer between 0 and 1000, will only save tags that have a higher relevance that this setting.
Default: {}
For better disambiguation, use this setting to map Calais types to freebase types.
Default: False
If the display fields are enabled, you can have freebase retrieve the description for the tags.
Default: "http://www.freebase.com/api/trans/raw"
The first part of the url from where to retrieve the descriptions.
Default: 0
Integer between 0 and 1000, tells SuperTagging the minimum relevance to use when marking up the content.
Default: "tagged"
If markup is enabled, SuperTagging will add a field to the instance with the marked up content, this setting specifies the suffix.
For example: if 'body' field is marked for tagging, by default a field called 'body__tagged' will be available in the instance that contains the content with marked up content.