@@ -0,0 +1,1790 @@
+package edu.neu.ccs.pyramid.experiment;%0A%0Aimport edu.neu.ccs.pyramid.configuration.Config;%0Aimport edu.neu.ccs.pyramid.dataset.ClfDataSet;%0Aimport edu.neu.ccs.pyramid.dataset.DataSetType;%0Aimport edu.neu.ccs.pyramid.dataset.TRECFormat;%0A%0Aimport java.io.*;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0A/**%0A * given feature indices, get feature names%0A * Created by chengli on 12/12/14.%0A */%0Apublic class Exp32 %7B%0A    public static void main(String%5B%5D args) throws Exception%7B%0A        if (args.length !=1)%7B%0A            throw new IllegalArgumentException(%22please specify the config file%22);%0A        %7D%0A%0A        Config config = new Config(args%5B0%5D);%0A        System.out.println(config);%0A%0A        File folder = new File(config.getString(%22input.folder%22));%0A        File trec = new File(folder,%22train.trec%22);%0A        ClfDataSet dataSet = TRECFormat.loadClfDataSet(trec, DataSetType.CLF_SPARSE,true);%0A        String featureIndicesFile = config.getString(%22featureIndicesFile%22);%0A        String line;%0A        try (BufferedReader br = new BufferedReader(new FileReader(featureIndicesFile)))%7B%0A            line = br.readLine();%0A        %7D;%0A%0A        String%5B%5D indices = line.split(%22 %22);%0A        int top = config.getInt(%22top%22);%0A        List%3CString%3E terms = new ArrayList%3C%3E();%0A        for (int i=0;i%3Ctop;i++)%7B%0A            int index = Integer.parseInt(indices%5Bi%5D);%0A            String term = dataSet.getFeatureSetting(index).getFeatureName();%0A            terms.add(term);%0A        %7D%0A%0A        String outputFolder = config.getString(%22output.folder%22);%0A        File output = new File(outputFolder,%22initialSeeds%22);%0A        try( BufferedWriter bw = new BufferedWriter(new FileWriter(output)))%7B%0A            for (String term: terms)%7B%0A                bw.write(term);%0A                bw.newLine();%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A

add Exp32