Fix string encoding for Value type
CONTRIBUTOR
That was fast! 

2021-10-25T14:00:21Z
https://github.com/huggingface/datasets/pull/3158#issuecomment-950958791
https://api.github.com/repos/huggingface/datasets/issues/3158
IC_kwDODunzps44rnrH
https://api.github.com/repos/huggingface/datasets/issues/comments/950958791/reactions
2021-10-25T14:00:21Z
https://api.github.com/repos/huggingface/datasets/issues/comments/950958791
https://avatars.githubusercontent.com/u/32632186?v=4
https://api.github.com/users/philschmid/events{/privacy}
https://api.github.com/users/philschmid/followers
https://api.github.com/users/philschmid/following{/other_user}
https://api.github.com/users/philschmid/gists{/gist_id}
https://github.com/philschmid
philschmid
MDQ6VXNlcjMyNjMyMTg2
https://api.github.com/users/philschmid/orgs
https://api.github.com/users/philschmid/received_events
https://api.github.com/users/philschmid/repos
https://api.github.com/users/philschmid/starred{/owner}{/repo}
https://api.github.com/users/philschmid/subscriptions
User
https://api.github.com/users/philschmid
public
Some metrics have `string` features but currently it fails if users pass integers instead. Indeed feature encoding that handles the conversion of the user's objects to the right python type is missing a case for `string`, while it already works as expected for integers, floats and booleans

Here is an example code that didn't work previously, but that works with this fix:
```python
import datasets

# Note that 'id' is an integer while the SQuAD metric uses strings
predictions = [{'prediction_text': '1976', 'id': 5}]
references = [{'answers': {'answer_start': [97], 'text': ['1976']}, 'id': 5}] 

squad_metric = datasets.load_metric("squad") 
squad_metric.add_batch(predictions=predictions, references=references) 
results = squad_metric.compute()
# {'exact_match': 100.0, 'f1': 100.0}
```

cc @sgugger @philschmid 