Closed harsham05 closed 5 years ago
Python 3.6.6 |Anaconda, Inc.| (default, Jun 28 2018, 17:14:51)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>>
>>> import torch
>>> torch.__version__
'0.4.1'
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Tue_Jun_12_23:07:04_CDT_2018
Cuda compilation tools, release 9.2, V9.2.148
sample10k.sentence.label.csv
is just the saved preprocessed dataset. We impute -1 into the label column if the label is missing.
Check your home directory for ~/clf_results.npy
as specified in the script.
Alternatively you can supply --write_results output_csv.csv
to save it in a csv.
Thank you @raulpuric That worked!
python classifier.py --load_model ~/imdb_clf.pt --data ~/sample10k.csv --write_results output_csv.csv
The predicted probabilities in the output_csv.csv make sense, but I'm guessing the imputed missing labels are copied as is to this file? Hence all the -1.0
yeah. It's helpful when you have a labeled test set, and want to easily check how the classifier did on your data.
I tried classifying text using both the Binary SST & Imdb pretrained models. But all 10,000 sentences/examples from my corpus were labeled -1.0 i.e negative sentiment ?
python classifier.py --load_model ~/imdb_clf.pt --test ~/sample10k.csv
My corpus looks like below
Output