Code Monkey home page Code Monkey logo

csl622_project's Introduction

user_dynamics

This project is about the characterisation of user contributions on a Wikipedia page.

1.The first part involves getting the data of the user contributions by reading the xml dump file and getting the username/ip address(if anonymous) and then getting the edits he/she has done in that particular page. This is using the users_list() function in new_file.py .

2.The second part involves training a model data using nltk and gensim models to create topics from reading the user contributions. This is done using the file train_model.py .

3.The third part involves getting the topics from the model just trained by reading the edits and feeding them to model just trained. This is done in the second part of the code in new_file.py but the function for topic creation i.e. getTopicForQuery() is defined in testing.py .

4.The new_file.py uses the xml.eTree library to parse the xml file and then storing the username/ip address and their edits in a dictionary as key value pair. Using the dictionary the edits are traversed and then stored in separate files with the same username/ip .txt naming convention stored inside the folder with the xml file name. Then the files are read and the getTopicForQuery() function is called on the edits to get the topics and they are stored in a 2D matrix.

Edit:-

5.A new code driver.py is created to model the topics that were calculated and stored in the 2D matrix. The similarity threshold is hardcoded for 70%. The word embedding is done using a file named "lexvec.commoncrawl.300d.W+C.pos.vectors" but it is not uploaded here(it's more than 5 GB). To download the file, open the link given below and then extract it and paste the content in the working directory...

https://www.dropbox.com/s/zkiajh6fj0hm0m7/lexvec.commoncrawl.300d.W%2BC.pos.vectors.gz?dl=1

How to run the code:

(if you want to train the model from scratch, not needed here as the trained model files are included so skip the first command)
$ python3 train_lda.py
$ python3 new_file.py xml_file_name(without the .xml extension)

Note:-For this code to work, please remove the attributes in mediawiki tag in the beginning of the xml file, then run the code.


Note:-Design Doc has been uploaded as CSL622_userCharacterization_report.pdf.

----------------------------------------------THE END-------------------------------------------------

csl622_project's People

Contributors

ankanbal avatar

Watchers

 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.