小编vik*_*ga9的帖子

使用Stanford CoreNLP

我正在尝试使用Stanford CoreNLP.我使用Web上的一些代码来了解coreference工具的用途.我尝试在Eclipse中运行该项目,但仍遇到内存不足异常.我尝试增加堆大小,但没有任何区别.关于为什么会这种情况发生的任何想法?这是特定于代码的问题吗?任何使用CoreNLP的方向都会很棒.

编辑 - 已添加代码

import edu.stanford.nlp.dcoref.CorefChain;
import edu.stanford.nlp.dcoref.CorefCoreAnnotations;
import edu.stanford.nlp.pipeline.Annotation;
import edu.stanford.nlp.pipeline.StanfordCoreNLP;


import java.util.Iterator;
import java.util.Map;
import java.util.Properties;


public class testmain {

    public static void main(String[] args) {

        String text = "Viki is a smart boy. He knows a lot of things.";
        Annotation document = new Annotation(text);
        Properties props = new Properties();
        props.put("annotators", "tokenize, ssplit, pos, parse, dcoref");
        StanfordCoreNLP pipeline = new StanfordCoreNLP(props);
        pipeline.annotate(document);


        Map<Integer, CorefChain> graph = document.get(CorefCoreAnnotations.CorefChainAnnotation.class);



        Iterator<Integer> itr = graph.keySet().iterator();

        while (itr.hasNext()) {

             String key = …
Run Code Online (Sandbox Code Playgroud)

java eclipse nlp stanford-nlp

7
推荐指数
1
解决办法
8685
查看次数

CUDA逆FFT错误

在进行逆FFT时,我有以下代码有错误.正向FFT工作,因为我打印输出并验证它.但反过来似乎没有.有任何想法吗?看起来我错过了一个概念吗?

代码 - http://pastebin.com/iZYtdcqR

编辑 - 我基本上重写了CUDA工具包示例附带的代码.我试图使用FFT但使用修改后的算法(实际上是DIF)执行卷积.

EDIT2 - 问题的dding代码.

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#include <cuda_runtime.h>
#include <cufft.h>

typedef enum signaltype {REAL, COMPLEX} signal;

typedef float2 Complex;

void
printData(Complex *a, int size, char *msg) {

  if (msg == "") printf("\n");
  else printf("%s\n", msg);

  for (int i = 0; i < size; i++)
    printf("%f %f\n", a[i].x, a[i].y);
}

void
normData(Complex *a, int size, float norm) {

  for (int i = 0; i < size; i++) {
    a[i].x /= norm; …
Run Code Online (Sandbox Code Playgroud)

cuda fft ifft

0
推荐指数
1
解决办法
965
查看次数

标签 统计

cuda ×1

eclipse ×1

fft ×1

ifft ×1

java ×1

nlp ×1

stanford-nlp ×1