input: Write a function to extract features from a json string. The function should accept a json string as input and return a dictionary containing the 'id', 'title', and the length of the 'body' as 'body_len'.
  
  def feature_extraction(input_str):
      import json
      data = json.loads(input_str)
  
      features = {
          "id": data["id"],
          "title": data["title"],
          "body_len": len(data["body"])
      }
  
      return features
  
  assert feature_extraction('{"id":111,"title":"This is a sample title","body":"This is a sample body text"}') == {"id": 111, "title": "This is a sample title", "body_len": 29}
  assert feature_extraction('{"id":222,"title":"Another title","body":"Short text"}') == {"id": 222, "title": "Another title", "body_len": 10}
  assert feature_extraction('{"id":333,"title":"","body":""}') == {"id": 333, "title": "", "body_len": 0}
output: def feature_extraction(input_str):
      import json
      data = json.loads(input_str)
  
      features = {
          "id": data["id"],
          "title": data["title"],
          "body_len": len(data["body"])
      }
  
      return features