Coder Social home page Coder Social logo

autotag's Introduction

INSTALLATION
==========================

Put it into the mod directory and enable it under Tool Administration


HOW TO USE (METHOD 1)
==========================
   
The (auto)tagging is provided by means of a hook and is typically invoked as follows.

    $tags = trigger_plugin_hook('autotag_kea', 'kea', $params); 

The associative array $params is used to provide the input text

    $params['text'] = $text (a string)

and several settings; $params[<setting-string>] = <setting>, where <setting-string> can be: 

- 'langID'      : The language to use; e.g. 'en' for English.
- 'weightArray' : The 3 weights for single words and 2 and 3 word combinations; e.g. array(1, 2, 3).
- 'maxReturn'   : The maximum number of tags to return; e.g. 5.
- 'minFreq'     : The minimum number of times a word is mentioned in the input text to be returned as tag; e.g. 2.
- 'minWordLen'  : All words smaller in length than this value are filtered out; e.g. 2

The found tags are returned as an associative array where every tag is associated
with its score. The score of a tag (a word or word combination) is calculated with the 
following formula.

    score[tag] = freq[tag] * weight[tag]

with

- freq[tag]   : The number of times the tag was found in the input text.
- weight[tag] : The weight depending on whether tag is a single word or 2 or 3 word combination.


HOW TO USE (METHOD 2)
==========================

The class used by the hook mentioned above is KEA (Keyword Extractor Algorithm),
which you can alternatively directly use in your PHP-code. 
After instantiation ($kea = new KEA()), use the following methods to provide the
several settings mentioned in the previous section. 

- $kea->set_langID()
- $kea->set_weightArray()
- $kea->set_maxReturn()
- $kea->set_minFreq()
- $kes->set_minWordLen()

KEA has one main method Autotag() which expects the input text/string as its sole 
argument and returns the tags-array described under "METHOD 1". 
				
PRECONFIGURED APPLICATIONS
==========================

As an application of these tagging routines the autotag hook is used in three Elgg
mods (blog, groups(forum) and pages) to augment the existing tagging in these mods. 
				

autotag's People

Contributors

rickterheide avatar

Stargazers

Florian DANIEL aka Facyla avatar Yurii Ishchenko avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.