Giter Club home page Giter Club logo

Comments (12)

w5688414 avatar w5688414 commented on July 18, 2024

可以参考源代码:

self._max_seq_len = kwargs.get("max_seq_len", 512)

fastdeploy的问题请参考repo:

https://github.com/PaddlePaddle/FastDeploy/tree/develop/examples/text/uie

from paddlenlp.

goldwater668 avatar goldwater668 commented on July 18, 2024

打扰了,PaddleNLP/paddlenlp/taskflow/information_extraction.py这里面也没有看到pred_threshold这个设置
https://github.com/PaddlePaddle/FastDeploy/tree/develop/examples/text/uie也没有看到阈值概率的设置,只看到这个position_prob
但是设置的position_prob为0.5,还是会出现'probability': 0.16951142251491547,
@w5688414 这是怎么回事呢

from paddlenlp.

w5688414 avatar w5688414 commented on July 18, 2024

请问怎么复现呢?

from paddlenlp.

goldwater668 avatar goldwater668 commented on July 18, 2024

使用my_ie = Taskflow("information_extraction",
schema=args.schema,
task_path=args.model_dir,
max_seq_len=512,
use_fast=True,
batch_size=32,
pred_threshold=0.9,
precision='fp16')
这个函数也会出现'probability': 0.6520814895629883

from paddlenlp.

goldwater668 avatar goldwater668 commented on July 18, 2024

或者使用position_prob=0.9,是不是可以认为probability的值无法通过position_prob和pred_threshold进行过滤

from paddlenlp.

w5688414 avatar w5688414 commented on July 18, 2024

我测了一下 position_prob没什么问题:

from paddlenlp import Taskflow
schema = ['Destination','Price','Time']


message = "Peace be upon you, dear. I want to book a ticket today to cairo in the evening with a price of 1000 to 2000 SAR"
my_ie = Taskflow("information_extraction",
        schema=schema,
        model='uie-base-en',
        max_seq_len=512,
        use_fast=True,
        batch_size=32,
        position_prob=0.9,
        precision='fp16'
        )
info = my_ie(message)
print(info)

self._position_prob = kwargs.get("position_prob", 0.5)

from paddlenlp.

goldwater668 avatar goldwater668 commented on July 18, 2024

position_prob=0.9是不是'probability '都是大于或者等于0.9的呢

from paddlenlp.

w5688414 avatar w5688414 commented on July 18, 2024

可以参考源代码,是大于。

if p > limit:

from paddlenlp.

goldwater668 avatar goldwater668 commented on July 18, 2024

我设置为position_prob=0.9,确实有出现'probability': 0.8505142460404365,不知道是怎么回事,

from paddlenlp.

w5688414 avatar w5688414 commented on July 18, 2024

请问这种情况怎么复现呢?

from paddlenlp.

goldwater668 avatar goldwater668 commented on July 18, 2024

我用的就是my_ie = Taskflow("information_extraction",
schema=args.schema,
task_path=args.model_dir,
max_seq_len=512,
use_fast=True,
batch_size=32,
pred_threshold=0.9,
precision='fp16')
模型使用uie训练自己的数据集得到的

from paddlenlp.

goldwater668 avatar goldwater668 commented on July 18, 2024

@w5688414 fastdeploy和taskflow不能共存吗?
PaddlePaddle/FastDeploy#2257
#8495

from paddlenlp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.