[General boards] [Fall 2018 courses] [Summer 2018 courses] [Winter 2018 courses] [Older or newer terms]

A3: q2btest.txt


#1

As far as I can tell we aren’t given any code to generate q2btest.txt so we have to write our own (from handout: “Also submit a file q2btest.txt that lists the labels you predict for the test set in (2b)”). What format should we put the data in? Also, I’d just like to check that the “labels predicted” are the labelled arcs, correct?

I asked Prof. Penn during class today and I was told to post onto the board. Thanks!


#2

I’ve just gone with printing out element-by-element the results of minibatch_parse run on the test set using the best model; hope that’s fine.


#3

(Finally) confirming that that’s indeed what we want.


#4

Do I need to include the code that generate the .txt file?


#5

It’s not required, but I’d include it just in case it’s useful for me to see exactly what you did (correctly or incorrectly). It won’t hurt to include it; it can only help.


#6

Just want to clarify, you just want the results dumped to a file right? No need for us to clean it up or nicely format it?


#7

Element-by-element printing of the minibatch_parse result on the test set is all that’s needed.


#8

Sorry to overfixate on this, but by element by element do you mean line by line? The current output I get is technically csv element by element (it comes straight out of the model), but it’s really unintelligible to the human eye (it’s all on one line). Thanks


#9

Line by line, print out each element of the result of minibatch_parse, using Python’s print function. minibatch_parse returns a list of lists, so each line will be the result of printing a list. That list contains the arc tuples for a single sentence.

i.e.

for sentence in minibatch_parse(...):
    print(sentence)

Obviously the exact code will depend on how you decide to modify the code to do this, but that should give you the general idea.


#10

Thanks! I’ll make some last minute changes now