public NoiseTagLdaModel(InputStream in) throws IOException {
  GZIPInputStream zipin=new GZIPInputStream(in);
  BufferedInputStream bin=new BufferedInputStream(zipin);
  DataInputStream datain=new DataInputStream(bin);
  numTopics=datain.readInt();
  int numWords=datain.readInt();
  alpha=datain.readDouble();
  beta=datain.readDouble();
  locked=datain.readBoolean();
  wnz=new int[numTopics];
  Arrays.fill(wnz,0);
  for (int i=0; i < numWords; i++) {
    String word=datain.readUTF();
    int[] count=new int[numTopics];
    for (int j=0; j < numTopics; j++) {
      count[j]=datain.readInt();
      wnz[j]+=count[j];
      nw+=count[j];
    }
    nwz.put(word,count);
  }
  tnz=new int[numTopics + 1];
  Arrays.fill(tnz,0);
  int numTags=datain.readInt();
  eta=datain.readDouble();
  for (int i=0; i < numTags; i++) {
    String word=datain.readUTF();
    int[] count=new int[numTopics + 1];
    for (int j=0; j < numTopics + 1; j++) {
      count[j]=datain.readInt();
      tnz[j]+=count[j];
      nt+=count[j];
    }
    ntz.put(word,count);
  }
  noise=numTopics;
}

public NoiseTagLdaModel ( InputStream in ) throws IOException { GZIPInputStream zipin = new GZIPInputStream ( in ) ; BufferedInputStream bin = new BufferedInputStream ( zipin ) ; DataInputStream datain = new DataInputStream ( bin ) ; numTopics = datain . readInt ( ) ; int numWords = datain . readInt ( ) ; alpha = datain . readDouble ( ) ; beta = datain . readDouble ( ) ; locked = datain . readBoolean ( ) ; wnz = new int [ numTopics ] ; Arrays . fill ( wnz , 0 ) ; for ( int i = 0 ; i < numWords ; i ++ ) { String word = datain . readUTF ( ) ; int [ ] count = new int [ numTopics ] ; for ( int j = 0 ; j < numTopics ; j ++ ) { count [ j ] = datain . readInt ( ) ; wnz [ j ] += count [ j ] ; nw += count [ j ] ; } nwz . put ( word , count ) ; } tnz = new int [ numTopics + 1 ] ; Arrays . fill ( tnz , 0 ) ; int numTags = datain . readInt ( ) ; eta = datain . readDouble ( ) ; for ( int i = 0 ; i < numTags ; i ++ ) { String word = datain . readUTF ( ) ; int [ ] count = new int [ numTopics + 1 ] ; for ( int j = 0 ; j < numTopics + 1 ; j ++ ) { count [ j ] = datain . readInt ( ) ; tnz [ j ] += count [ j ] ; nt += count [ j ] ; } ntz . put ( word , count ) ; } noise = numTopics ; }
load an existing model .
