Giter VIP home page Giter VIP logo

detnet's Introduction

Weakly Supervised Domain Detection

This repository releases the code and data for weakly supervised domain detection. Please cite the following paper [bib] if you find our code /data resource useful to you,

In this paper we introduce domain detection as a new natural language processing task. We argue that the ability to detect textual segments which are domain-heavy, i.e., sentences or phrases which are representative of and provide evidence for a given domain would enable the development of domain aware tools and increase the domain coverage for practical applications. We propose an encoder-detector framework for domain detection and bootstrap classifiers with multiple instance learning (MIL). The models are hierarchically organized and suited to multilabel classification. We demonstrate that despite learning from minimal supervision, our models can be applied to text spans of different granularities, languages, and genres. We also explore the potential of domain detection for text summarization.

Should you have any query please contact me at [email protected].

Project Structure

DomainDetection
│   README.md
│   spec-file.text
└───src
│   └───frame  # DetNet framework
│       │   encoder.py
│       │   detector.py
│       │   ...
│   └───config  # configuration files
│   └───data  # dataset parsing, building and piping
│   └───utils  # miscellaneous utils 
└───dataset
│   └───en  # English dataset
│       └───...
│   └───zh  # Chinese dataset
│       └───...
└───res  # resources (vocabulary)
│   └───vocab
│       └───en  # English vocabulary
│           │   vocab
│       └───zh  # Chinese vocabulary
│           │   vocab
└───model  # trained models
│   └───en  # English models
│       │   DetNet
│       │   ...
│   └───zh  # Chinese models
│       │   DetNet
│       │   ...
└───log

Environment Setup

You can check the spec-file.txt provided in this project for the list of packages required.

To create a suitable environment conviniently with conda, do:

conda create --name myenv --file spec-file.txt

or alternatively, you may prefer to install required packages into an existing environment:

conda install --name myenv --file spec-file.txt

Dataset

You can download our datasets for both English and Chinese via Google Drive.

After uncompressing *.zip files, put them under dataset/en or dataset/zh, respectively. These include data for model training, development and test. Note that test is for document-level test, and syn_docsis for sentence-level test with synthesized contexts (check the algorithm proposed in our paper for details).

*.json files include documents sampled from Wikipedia (in both en and zh) and NYT (in en); these documents are manually labeled via MTurk at both sentence-level and word-level for test purpose.

detnet's People

Contributors

yumoxu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

detnet's Issues

Problem to run code

Hi,

First, thanks a lot for the interesting work and for releasing the code.

I met some problems when trying to run the code. First, some errors occur due to misaligning between 'src/config/config_path.yml' and 'config_loader.py', specifically, proj_path including 'test_sents' (which seems useless in code) and 'label_consistency_assumption' (which seems more important) are missing.

After I "bypass" the above errors according to my understanding, a new error saying "No module named 'summ'" occurs in /src/fram/top_words.py.

Looking forward to hearing from you.

Thanks

Errors when running code

Thanks for updating!

I ran into another issue: AttributeError: type object 'DetNet' has no attribute 'use_top'.

And after I "bypass" the above issue, another thing came up:
Traceback (most recent call last):
File "src/main.py", line 105, in
model = make_model(**model_paras)
File "/media/dylanz/MyFiles/Siyang/detnet/src/frame/model.py", line 461, in make_detnet_model
model_components['sent_det'] = SentDomDetector(**sent_det_para)
File "/media/dylanz/MyFiles/Siyang/detnet/src/frame/detector.py", line 262, in init
topic_ids = side_info['topic_ids']
KeyError: 'topic_ids'

Could you please help me solve these issues?
Thanks a lot!

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.