AILearn
Problems

240. Top-P (Nucleus) Sampling

Medium

Implement Top-P (Nucleus) Sampling for natural language processing.

Test Cases

Test Case 1
Input: Example input 1
Expected: Expected output 1
Test Case 2
Input: Example input 2
Expected: Expected output 2
+ 1 hidden test cases
Python 3
Loading editor...
Console Output
Click "Run" to test your code or "Submit" to submit your solution.