ITADN

Example code for doing EL and RE in a single pass?

#30Closedadsharma 创建于 2025-02-13
A
adsharmacommented
Is this the right way? ``` from relik.reader.pytorch_modules.triplet import RelikReaderForTripletExtraction # the reader for triplet extraction reader = RelikReaderForTripletExtraction( "sapienzanlp/relik-reader-deberta-v3-large-nyt" ) candidates = ["Michael Jordan", "NBA", "Chicago Bulls", "Basketball", "United States"] reader.read("Michael Jordan was one of the best players in the NBA.", candidates=candidates) ``` The above fails with: > 197 raise ValueError("`text` and `candidates` must have the same length.") I tried what's in README.md: ``` from relik.reader import RelikReaderForTripletExtraction # fails to import ```
关闭于 2025-07-24 2 条评论