All Projects → tuhinjubcse → SarcasmGeneration-ACL2020

tuhinjubcse / SarcasmGeneration-ACL2020

Licence: other
A retrieve and edit approach to generate sarcasm by reversing valence and adding incongruent common sense context

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to SarcasmGeneration-ACL2020

rhme-2016
The RHme2 (Riscure Hack me 2) is a low level hardware CTF challenge that comes in the form of an Arduino Nano board. The new edition provides a completely different set of new challenges to test your skills in side channel, fault injection, cryptoanalysis and software exploitation attacks.
Stars: ✭ 42 (+90.91%)
Mutual labels:  reverse
fnseedc
Collection of resources for Minecraft Seedcracking
Stars: ✭ 33 (+50%)
Mutual labels:  reverse
django-js-routes
Expose and perform reverse lookups of Django URLs in the frontend world.
Stars: ✭ 20 (-9.09%)
Mutual labels:  reverse
akamai-toolkit
A set of tools to work on Akamai v1 anti-bot solution. Current supported version: 1.70
Stars: ✭ 215 (+877.27%)
Mutual labels:  reverse
Hellf
ELF patching library in Python
Stars: ✭ 18 (-18.18%)
Mutual labels:  reverse
CommentView-4-IDAPRO-7.0
CommentView 4 IDAPRO 7.0
Stars: ✭ 54 (+145.45%)
Mutual labels:  reverse
afinn-111
AFINN 111 (list of English words rated for valence) in JSON
Stars: ✭ 44 (+100%)
Mutual labels:  valence
ReHitman
Hitman Blood Money Reverse Project
Stars: ✭ 29 (+31.82%)
Mutual labels:  reverse
reverse android
安卓从开发到逆向
Stars: ✭ 65 (+195.45%)
Mutual labels:  reverse
CTF
CTF binary exploit code
Stars: ✭ 37 (+68.18%)
Mutual labels:  reverse
vex
reverse HTTP proxy tunnel via secure SSH connections.
Stars: ✭ 20 (-9.09%)
Mutual labels:  reverse
allsafe
Intentionally vulnerable Android application.
Stars: ✭ 135 (+513.64%)
Mutual labels:  reverse
observations
Beobachtungen und Betrachtungen rund um das Informatik-Studium an der HSLU
Stars: ✭ 45 (+104.55%)
Mutual labels:  sarcasm
geocoder
Geocoder is a Typescript library which helps you build geo-aware applications by providing a powerful abstraction layer for geocoding manipulations
Stars: ✭ 28 (+27.27%)
Mutual labels:  reverse
cpu11
Revengineered ancient PDP-11 CPUs, originals and clones
Stars: ✭ 120 (+445.45%)
Mutual labels:  reverse
slopShell
the only php webshell you need.
Stars: ✭ 208 (+845.45%)
Mutual labels:  reverse
ReHitman
Hitman Gen 1 Reverse Engineering Project
Stars: ✭ 21 (-4.55%)
Mutual labels:  reverse
raisin
Reverse shell and rootkit
Stars: ✭ 18 (-18.18%)
Mutual labels:  reverse
leysourceengineclient
A source engine network client implementation based on some of my reversing work with basic functionality ( joining servers, talking, receiving/sending voicedata etc. ). Made this & reversed netchan to learn about Sources networking.
Stars: ✭ 122 (+454.55%)
Mutual labels:  reverse
toolset
Useful tools for CTF competitions
Stars: ✭ 31 (+40.91%)
Mutual labels:  reverse

Please leave a star if you use our code

The input for our experiments are located in the folder data/non-sarcastic.txt

The generation for our paper is a three staged pipeline process

We convert a non-sarcastic utterance to a sarcastic

R-3

conda create --name R3 python=3.6

conda activate R3

#point your LD_LIBRARY_PATH to your miniconda or anaconda library

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/nas/home/tuhinc/miniconda3/lib/

Clone this repo.

  • cd SarcasmGeneration-ACL2020

  • install nltk

  • To just reverse the valence of the input (REVERSE)

    • Run python reverse.py $input
    • This will print the output in the console
  • To retrieve the commonsense keyword associated with the input you need to do the below(RETRIEVE)

    - Download a chunk of the retreival corpus from the timestamp of the experiment from the link below and put inside data folder (https://drive.google.com/file/d/1cX-iy58B0F1K2nVD5sMiSIxd-8lFx7ok/view?usp=sharing)
    • cd comet-commonsense

      To run the setup scripts to acquire the pretrained model files from OpenAI, as well as the ATOMIC and ConceptNet datasets

      bash scripts/setup/get_atomic_data.sh
      bash scripts/setup/get_conceptnet_data.sh
      bash scripts/setup/get_model_files.sh
      

      Then install dependencies (assuming you already have Python 3.6 ):

      pip install torch==1.3.1
      pip install tensorflow
      pip install ftfy==5.1
      conda install -c conda-forge spacy
      python -m spacy download en
      pip install tensorboardX
      pip install tqdm
      pip install pandas
      pip install ipython
      pip install inflect
      pip install pattern
      pip install pyyaml==5.1
      
      

      Making the Data Loaders

      Run the following scripts to pre-initialize a data loader for ATOMIC or ConceptNet:

      python scripts/data/make_atomic_data_loader.py
      python scripts/data/make_conceptnet_data_loader.py
      

      Download pretrained COMET

      First, download the pretrained models from the following link:

      https://drive.google.com/open?id=1FccEsYPUHnjzmX-Y5vjCBeyRt1pLo8FB
      

      Then untar the file:

      tar -xvzf pretrained_models.tar.gz
      
      
      

Make sure your directory resembles this https://github.com/tuhinjubcse/SarcasmGeneration-ACL2020/blob/master/comet-commonsense/directory.md

  • Finally to generate sarcasm , pick an utterance from data/non-sarcastic.txt and run the following command which inclueds REVERSE , RETRIEVE , RANK together

    • Run python generate_sarcasm.py $input
    • This will print the output in the console

Email me at [email protected] for any problems/doubts. Further you can raise issues on github, or suggest improvements.

If you use code or data please cite us

      @inproceedings{chakrabarty-etal-2020-r,
   title = "{R}{\^{}}3: Reverse, Retrieve, and Rank for Sarcasm Generation with Commonsense Knowledge",
   author = "Chakrabarty, Tuhin  and
     Ghosh, Debanjan  and
     Muresan, Smaranda  and
     Peng, Nanyun",
   booktitle = "Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics",
   month = jul,
   year = "2020",
   address = "Online",
   publisher = "Association for Computational Linguistics",
   url = "https://www.aclweb.org/anthology/2020.acl-main.711",
   pages = "7976--7986",
}

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].