Starting from:
$30

$24

Coding Assignment 4: Precondition Inference


Overview
In this assignment, you will be given a set of sentence pairs. For each pair of sentence, the first one is considered as a precondition, while the second one is a statement. The goal is to develop a natural language reasoner to decide whether the precondition will enable or disable the statement.

For example: given the statement "A glass can be used to drink water", then the precondition "water is clean" enables this statement, while the precondition "the glass is completely broken" disables this statement.

You are free to experiment with any methods of representation, encoding , including any pre-trained models. Submit your prediction on the unlabeled test set. We will compare your prediction with the ground-truth labels of the test set on our side. Grading will be based on the ranking of your submitted prediction among all of those in the class.

(Please make sure to read the Q&A part)

Data and Jupyter Notebook
A compressed ZIP file is to be released on Blackboard when the assignment is available. The uncompressed archive contain the following files:

main.ipynb: The Python 3 Jupyter notebook you will need to fill in with your training and inference code, and predict the results.

data folder:

pnli_train.tsv: labeled training data in csv format. Each line is tuple in the form of (precondition, statement, label). label=1 means "enable" and label=0 means "disable".

pnli_dev.tsv: labeled dev data.

pnli_test_unlabeled.tsv: unlabled test data. Each line is a pair of precondition and statement.

upload_document.txt: the documentation file where you need to fill in the blanks to describe your method.

This dataset is internal to the CSCI 544 class in Spring 2022. You are not allowed to distribute the dataset to whoever is not a part of this class. Any such unallowed distribution is is subject to severe penalty (including getting zero credit).

Programs and Models
We again provide a jupyter notebook which provides the starting code for reading the data, and the end part to generate "upload_predictions.txt". You need to fill in the "Main Code Body", and put the 4850 predictioned labels into the results list.

Restrictions. 

Your method needs to be implemented using python 3. You are free to use any python package (e.g., pytorch, Huggingface, AllenNLP, etc.).

You are free to include any pre-trained models (any versions of Transformer language models, pre-trained NLI models, pre-trained QA models, etc.). However, only free models are allowed (hence, you cannot prompt GPT-3).

You can consider doing your experiment on Google Colab (which provides a free student membership), your own machine, or any computating resources that are available to you.

Submission
This assignment requests submitting three files (DO NOT CHANGE the filenames):

upload_predictions.txt: The predictions of your model on the 4850 unlabeled test set of sentence pairs. This file should have exactly 4850 lines, every line is either 0 or 1. (submit this on Vocareum)

upload_document.txt: Fill in the blanks of that file to accordingly describe how your model is developed. (submit this on Blackboard)

main.ipynb: This Jupyter notebook already contains the beginning part to read the data, and the end part to generate "upload_predictions.txt". You need to fill in the "Main Code Body"  (submit this on Blackboard).

Multiple submissions are allowed; only the final submission will be graded. Do not include any other files in your submission.  You are encouraged to submit early and often in order to iron out any problems, especially issues with the format of the final output.

We will again use a leaderboard protocol: the ground-truth labels on the test set are not released to you, and we will compare your prediction with them to calculate the accuracy of your prediction.

The prediction of your predictions will be measured automatically; failure to format your output correctly may result in very low scores, which will not be changed.

For full credit, make sure to submit your assignment well before the deadline. The time of submission recorded by the system is the time used for determining late penalties. If your submission is received late, whatever the reason (including equipment failure and network latencies or outages), it will incur a late penalty.

Make sure you have really submitted your files, not just uploaded. Otherwise, late penalty will still be applied accordingly (20% after the submission deadline, and 40% after the late submission deadline). The prediction results are automatically graded and will not be regraded after the late submission deadline as set by the course policy.

More products