Examples of FeatureExtractor


Examples of com.meapsoft.featextractors.FeatureExtractor

   
    for (int i = 0; i < featureStrings.length; i++)
    {
      try
      {
        FeatureExtractor fE = (FeatureExtractor)(Class.forName("com.meapsoft.featextractors." + featureStrings[i]).newInstance());
        featureExtractors.add(fE);
      }
      catch (Exception e)
      {
        System.out.println("uh oh in getFeatures...");
View Full Code Here

Examples of com.meapsoft.featextractors.FeatureExtractor

      // compute features from the STFT
      ListIterator i = featExts.listIterator();
      while (i.hasNext())
      {
        FeatureExtractor fe = (FeatureExtractor) i.next();
        // we don't want to run meta feature extractors yet!
        if (!(fe instanceof MetaFeatureExtractor))
        {
          //System.out.println("\ndoing: " + fe.description().substring(0,30));
          long chunkStartFrame = stft.seconds2fr(ch.startTime);
          int nframes = (int) stft.seconds2fr(ch.length);
          long chunkEndFrame = chunkStartFrame + nframes;

          // make sure stft contains valid data for us.
          long lastFrame = stft.getLastFrameAddress();
         
          int numFramesToRead = 0;
          int framesRead = -1;
         
          if (chunkStartFrame > lastFrame)
          {
            numFramesToRead = (int) (chunkStartFrame - lastFrame + nframes + 1);
            framesRead = stft.readFrames(numFramesToRead);
            //System.out.println("chunkStartFrame > lastFrame");
          }
          else if (chunkEndFrame > lastFrame)
          {
            numFramesToRead = (int) (chunkEndFrame - lastFrame + 1);
            framesRead = stft.readFrames(numFramesToRead);
            //System.out.println("chunkEndFrame > lastFrame");
          }
         
          //System.out.println("chunkStartFrame: " + chunkStartFrame + " nframes: " + nframes +
          //    " chunkEndFrame: " + chunkEndFrame + " numFramesToRead: " + numFramesToRead +
          //    " framesRead: " + framesRead + " lastFrame: " + lastFrame);
          double[] feats = fe.features(stft, (int) chunkStartFrame,
              nframes, true);

          ch.addFeature(feats);

          // what features are we adding?
          if (!wroteFeatDesc)
          {
            String fullName = fe.getClass().getName();
            //System.out.println("fullName: " + fullName);
            String[] nameParts = fullName.split("\\.");
            String featString = nameParts[nameParts.length - 1] + "("
                + feats.length + ") ";
            //System.out.println("featString: " + featString);
            if (featExtWeights != null)
            {
              int idx = i.nextIndex() - 1;
              if (idx < featExtWeights.size())
                featString = featExtWeights.get(idx) + "*"
                    + featString;
            }
            file.featureDescriptions.add(featString);
          }
        }

        progress.setValue(progress.getValue() + 1);
      }

      wroteFeatDesc = true;
    }

    // now do meta feature extractors
    boolean descriptionsCleared = false;
    ListIterator i = featExts.listIterator();
    while (i.hasNext())
    {
      FeatureExtractor fe = (FeatureExtractor) i.next();
      if (fe instanceof MetaFeatureExtractor)
      {
        if (!descriptionsCleared)
        {
          if (clearNonMetaFeatures)
            file.featureDescriptions.clear();

          file.normalizeFeatures();
          file.applyFeatureWeights();

          descriptionsCleared = true;
        }

        // this obliterates any other features
        ((MetaFeatureExtractor) fe)
            .features(file, clearNonMetaFeatures);

        // what features are we adding?
        String featString = fe.getClass().getName() + "(" + 1 + ") ";
        if (featExtWeights != null)
        {
          int idx = i.nextIndex() - 1;
          if (idx < featExtWeights.size())
            featString = featExtWeights.get(idx) + "*" + featString;
View Full Code Here

Examples of com.meapsoft.featextractors.FeatureExtractor

    //JPanel mFEPanel = null;
    for (int i = 0; i < classNames.size(); i++)
    {
      String name = (String)classNames.elementAt(i);
     
      FeatureExtractor f = null;
      try
      {
        f = (FeatureExtractor)(Class.forName("com.meapsoft.featextractors." + name).newInstance());
      }
      catch (Exception e)
View Full Code Here

Examples of com.meapsoft.featextractors.FeatureExtractor

            if(v2 != null)
                v.addAll(v2);
           
            for (int i = 0; i < v.size(); i++)
            {
        FeatureExtractor f = null;
       
        try
        {
          String name = "com.meapsoft.featextractors." + (String)v.elementAt(i);
          f = (FeatureExtractor)(Class.forName(name).newInstance());
          featureDescriptions.add(f.description());
        }
        catch (Exception e)
        {
          GUIUtils.ShowDialog("", GUIUtils.MESSAGE, meapsoftGUI.jframe)
                    //ShowDialog(e, "", FATAL_ERROR);
View Full Code Here

Examples of com.meapsoft.featextractors.FeatureExtractor

            try
            {
                if (cb.isSelected())
                {
                  FeatureExtractor fe = (FeatureExtractor)(Class.forName("com.meapsoft.featextractors." + cb.getText())
          .newInstance());
          if (fe instanceof MetaFeatureExtractor)
            metaFE = true;
          else
            regularFE = true;
View Full Code Here

Examples of com.meapsoft.featextractors.FeatureExtractor

            // compute features from the STFT
            ListIterator i = featExts.listIterator();
            while(i.hasNext())
            {
        FeatureExtractor fe = (FeatureExtractor)i.next();
        //we don't want to run meta feature extractors yet!
        if (!(fe instanceof MetaFeatureExtractor))
        {         
                    long chunkStartFrame = stft.seconds2fr(ch.startTime);
                    int nframes = (int)stft.seconds2fr(ch.length);
                    long chunkEndFrame = chunkStartFrame + nframes;
                   
                    // make sure stft contains valid data for us.
                    long lastFrame = stft.getLastFrameAddress();
                    if(chunkStartFrame > lastFrame)
                        stft.readFrames(chunkStartFrame - lastFrame + nframes + 1);
                    else if(chunkEndFrame > lastFrame)
                        stft.readFrames(chunkEndFrame - lastFrame + 1);

                   
                    double[] feats = fe.features(stft, (int)chunkStartFrame, nframes);

                  ch.addFeature(feats);
 
                    // what features are we adding? 
                  if(!wroteFeatDesc)
                  {
            String featString = fe.getClass().getName() + "(" + feats.length + ") ";
                        if(featExtWeights != null)
                        {
                            int idx = i.nextIndex()-1;
                            if(idx < featExtWeights.size())
                                featString = featExtWeights.get(idx)+"*"+featString;
                        }
                      file.featureDescriptions.add(featString);
                  }
        }

                progress.setValue(progress.getValue()+1);
            }

            wroteFeatDesc = true;
        }
   
    //now do meta feature extractors
    boolean descriptionsCleared = false;
    ListIterator i = featExts.listIterator();
    while(i.hasNext())
    {
      FeatureExtractor fe = (FeatureExtractor)i.next();
      if (fe instanceof MetaFeatureExtractor)
      { 
        if (!descriptionsCleared)
        {
                    if(clearNonMetaFeatures)
                        file.featureDescriptions.clear();

                    // sk: remove normalization and feature weighting
                    //file.normalizeFeatures();
                    //file.applyFeatureWeights();

          descriptionsCleared = true;
        }

                // this obliterates any other features
                ((MetaFeatureExtractor)fe).features(file, clearNonMetaFeatures);
       
        // what features are we adding? 
        String featString = fe.getClass().getName() + "(" + 1 + ") ";
                if(featExtWeights != null)
                {
                    int idx = i.nextIndex()-1;
                    if(idx < featExtWeights.size())
                        featString = featExtWeights.get(idx)+"*"+featString;
 
View Full Code Here

Examples of opennlp.ccg.parse.supertagger.ml.FeatureExtractor

              tde.extract();
            } else {
                // train (extract features).       
                File inf = options.valueOf(inputspec);
                File outf = options.valueOf(outputspec);
                FeatureExtractor fexer = (stPrior == null) ? new STFex() : new STFex(stPrior);
                ZhangLeTrainingExtractor fexApp = new ZhangLeTrainingExtractor(inf, outf, options.valueOf(tokenisation), fexer);
                System.err.println("Extracting features from file: " + inf.toString() + ", and placing extracted features in: " + outf.toString() + ".");
                fexApp.writeFeats();
            }
View Full Code Here

Examples of org.vocvark.AudioFeatures.FeatureExtractor

            // Extract the features one by one
            for (int feat = 0; feat < featureExtractors.size(); feat++) {
                // Only extract this feature if enough previous information is available to extract this feature
                if (win >= maxFeatureOffsets[feat]) {
                    // Find the correct feature
                    FeatureExtractor feature = featureExtractors.get(feat);

                    // Find previously extracted feature values that this feature needs
                    double[][] otherFeatureValues = null;
                    if (featureExtractorDependencies[feat] != null) {
                        otherFeatureValues = new double[featureExtractorDependencies[feat].length][];
                        for (int i = 0; i < featureExtractorDependencies[feat].length; i++) {
                            int feature_indice = featureExtractorDependencies[feat][i];
                            int offset = feature.getDependencyOffsets()[i];
                            otherFeatureValues[i] = results[win + offset][feature_indice];
                        }
                    }
                    // Store the extracted feature values
                    results[win][feat] = feature.extractFeature(window, settings.getSamplingRate(), otherFeatureValues);
                } else
                    results[win][feat] = null;
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.