Code Monkey home page Code Monkey logo

document-similarity-via-hidden-topics's Introduction

This is the repository for paper "Document Similarity for Texts of Varying Lengths via Hidden Topics" to appear in ACL 2018.
This is a system implemented by Hongyu Gong in python for matching long documents and short documents (e.g. summary).

Structure:
src/ is the source code of the document matching system.
concept-project-mapping-dataset/ prepares the data for the task of concept-project matching.=


Required package:
a) gensim
b) sklearn
c) nltk
1. Input data format
raw_short_docs: a list of strings where each string is the abstract;
raw_long_docs: a list of strings where each string is a long document;

2. Run main.py
- Set hyperparameters properly (the default parameters are what we used in the paper);
- Specify the path of word embeddings.
- You need to write function to read data into specified format. You can refer to the function readData()in test.py.
Return: The function mapping() in main.py will return a score matrix, and the (i,j)-th entry in the matrix is the matching score of the i-th short document and the j-th long document. 
Note that the score is a real value between 0 and 1. The higher the score is, the better they match each other.

<b> Note that you can run test.py which returns matching scores for the project-concept pairs.</b>


Furthermore, we provide science-domain corpara extracted from the WikiCorpus, which are used to train science-domain embeddings:
(1) [science_corpus_d2](https://drive.google.com/open?id=1BIyKO9xMqpNOO7EordP9_kS0Zr2tIiNx): a refined corpus of 90 MB consists of documents within depth of 2 in science categories;
(2) [science_corpus_d3](https://drive.google.com/open?id=1xsJymoKZi2Fr2SCTDwSJzZid13Lp7PO4): a larger corpus of 2GB consists of documents within depth of 3 in science categories.

If you have any questions, please contact Hongyu Gong ([email protected]).

If you use our code/data, please cite our work:
Hongyu Gong, Tarek Sakakini, Suma Bhat and Jinjun Xiong, “Document Similarity for Texts of Varying Lengths via Hidden Topics”, accepted by the 56th Annual Meeting of the Association for Computational Linguistics (ACL), 2018.
@inproceedings{docsim,
  author    = {Hongyu Gong, Tarek Sakakini, Suma Bhat and Jinjun Xiong},
  title     = {Document Similarity for Texts of Varying Lengths via Hidden Topics},
  booktitle = {the 56th Annual Meeting of the Association for Computational Linguistics (ACL)},
  month     = {July},
  year      = {2018},
  publisher = {Association for Computational Linguistics}
}

document-similarity-via-hidden-topics's People

Contributors

hongyugong avatar

Watchers

 avatar  avatar  avatar  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.