1 個回答
- 最新
- 最多得票
- 最多評論
0
Hi Guru,
I apologize for responding to your post so late. I've been researching how to restrict the number of words retrieved to a maximum of 50 using the filter attribute. Unfortunately, Amazon Bedrock doesn't natively support truncating text responses based on word count using metadata attributes. Therefore, you would need to manage this requirement through:
- Calculate the
numberOfWords
for each document during pre-processing. Include this custom metadata in the document. For example, you can add"numberOfWords": 76
to indicate the total word count. - Amazon Bedrock's filtering capabilities enable you to filter based on numerical comparisons in metadata values.
- You can query using a filter based on
numberOfWords < 50
to include the documents that match this attribute.
⚠️ I haven't tested this solution, but it may work.
ℹ️ However, I believe preprocessing will be necessary to achieve this.
Thanks very much Osvaldo. I'll give it a try!
Let me know if this solution works
相關內容
- 已提問 10 個月前
- AWS 官方已更新 9 個月前
- AWS 官方已更新 2 年前
- AWS 官方已更新 2 年前
any answers for this is much appreciated?