小编Iai*_*ick的帖子

AWS API 网关 {"message":"缺少身份验证令牌"}

我正在使用 API Gateway 构建 REST API,以通过 aws lambda 与部署的 aws sagemaker 模型进行通信。当我测试方法(方法测试结果)时,我的 lambda 函数返回所需的结果。我确实部署了 API,并且我使用了正确的调用 URL,并附加了资源名称(方法调用 URL)。最后,我检查了此方法请求的所有身份验证设置(方法身份验证设置)。当我将调用 URL 输入浏览器或尝试调用 REST API(来自 cloud9 IDE——我正在开发的 Web 应用程序)时,我收到此错误:{"message":"Missing Authentication Token"} ( URL Response )

我的API很简单,只有一个POST请求,不包含任何其他资源或方法。我还尝试在“/”下设置方法,但遇到了同样的问题。

有很多人有这个问题,我花了一段时间阅读类似的帖子 - 但解决方案归结为我在上面检查过的问题。如果有人可以提供帮助,将不胜感激!

伊恩

amazon-web-services aws-api-gateway

7
推荐指数
2
解决办法
3823
查看次数

如何使用 NLTK 正则表达式模式用 UP/DOWN 指标注释财经新闻?

我正在复制本文中描述的算法:https : //arxiv.org/pdf/1811.11008.pdf

在最后一页,它使用以下示例描述了提取在标记为“NP JJ”的语法中定义的叶: 营业利润率为 8.3%,而一年前为 11.8%。

我期待看到一片标有“NP JJ”的叶子,但我没有。我正在纠结为什么(对正则表达式来说相对较新。)

def split_sentence(sentence_as_string):
    ''' function to split sentence into list of words
    '''
    words = word_tokenize(sentence_as_string)

    return words

def pos_tagging(sentence_as_list):

    words = nltk.pos_tag(sentence_as_list)

    return words

def get_regex(sentence, grammar):

    sentence = pos_tagging(split_sentence(sentence));

    cp = nltk.RegexpParser(grammar) 

    result = cp.parse(sentence) 

    return result


example_sentence = "Operating profit margin was 8.3%, compared to 11.8% a year earlier."

grammar = """JJ : {< JJ.? > ?}
            V B : {< V B.? >}
            NP : {(< …
Run Code Online (Sandbox Code Playgroud)

python regex nlp nltk

4
推荐指数
1
解决办法
138
查看次数

标签 统计

amazon-web-services ×1

aws-api-gateway ×1

nlp ×1

nltk ×1

python ×1

regex ×1