Use Pointwise mutual information (PMI), or point mutual information to
- (Recommended): Use docker-compose to install
If you want to integrate PMIofKCM
into your own django project, use manually install.
pip install PMIofKCM
- add django app
PMIofKCM
insettings.py
:
-
add this:
INSTALLED_APPS=[ ... ... ... 'PMIofKCM', ]
- add url patterns of PMIofKCM into
urls.py
:
-
add this:
# pmiOfKcm import PMIofKCM.urls urlpatterns += [ url(r'^pmi/', include(PMIofKCM.urls)) ]
- use
python3 manage.py buildPMI --lang <lang, e.g., zh or en or th>
to build model of PMIofKCM. - fire
python manage.py runserver
and go127.0.0.1:8000/
to check whether the config is all ok.
- the result of querying pmi model with keyword
歐洲足球會協會
(Captain America):/pmi
-
keyword
-
num (default=10)
-
keyFlag (default=[])
-
valueFlag (defualt=[])
-
example1:http://udiclab.cs.nchu.edu.tw/pmi/?keyword=歐洲足球會協會&lang=zh
{ "value": [ [ "足協", 182.54887901332577 ], [ "歐洲足球", 164.40832185981395 ], [ "成員國", 160.17033554655106 ], [ "會員", 155.96658603881642 ], [ "歐洲", 155.04907093836462 ], [ "UEFA", 151.3463095860187 ] ], "similarity": 1, "key": "歐洲足球會協會" }
PMIofKCM is a django-app, so depends on django project.
- python3.5
- pymongo
- 陳聖軒
- 張泰瑋 david
This package use GPL3.0
License.