Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement precision_score function and test aligned with sklearn metrics #28407

Merged
merged 68 commits into from
Mar 5, 2024

Commits on Sep 4, 2023

  1. Create func_wrapper.py

    func_wrapper.py is a Python module designed to streamline the integration of Hugging Face Transformers into your natural language processing (NLP) projects. It provides a set of input and output conversion wrappers to simplify the process of passing data between your custom functions and Transformers' data structures.
    
    Input Conversion Wrappers:
    
    inputs_to_transformers_tensors: This wrapper converts input data (text, tensors, etc.) into Transformers-compatible data structures. It is particularly useful when your custom functions expect diverse input types.
    Output Conversion Wrappers:
    
    outputs_to_pytorch_tensors: After your custom function returns data, this wrapper ensures that the output data is converted into PyTorch tensors or other appropriate formats.
    Usage:
    
    Import func_wrapper.py into your project.
    Initialize a Hugging Face Transformers model and tokenizer.
    Wrap your custom function with to_transformers_tensors_and_back. This wrapped function can now accept and return Transformers-compatible data.
    Here's a simple example of how to use func_wrapper.py:
    
    import torch
    from transformers import BertForSequenceClassification, BertTokenizer
    from iivy.functional.frontends.transformers.func_wrapper import to_transformers_tensors_and_back
    
    # Initialize the model and tokenizer
    model_name = "bert-base-uncased"
    model = BertForSequenceClassification.from_pretrained(model_name)
    tokenizer = BertTokenizer.from_pretrained(model_name)
    
    # Wrap your custom function using the conversion wrappers
    wrapped_function = to_transformers_tensors_and_back(your_function, model, tokenizer)
    
    # Prepare sample input data
    sample_input_text = "This is a sample input text."
    sample_input_tensor = torch.rand((3, 3))
    
    # Call your wrapped function with the sample input data
    output = wrapped_function(sample_input_text, sample_input_tensor)
    
    # The output is automatically converted to PyTorch tensors
    print(output)
    
    Please note that func_wrapper.py is still in development, and further enhancements and refinements are expected. Your feedback and contributions to improve its functionality are welcome.
    muzakkirhussain011 authored Sep 4, 2023
    Configuration menu
    Copy the full SHA
    54e5e6f View commit details
    Browse the repository at this point in the history

Commits on Feb 23, 2024

  1. Configuration menu
    Copy the full SHA
    8a9de57 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ce7067e View commit details
    Browse the repository at this point in the history
  3. 🤖 Lint code

    ivy-branch committed Feb 23, 2024
    Configuration menu
    Copy the full SHA
    81ecd3f View commit details
    Browse the repository at this point in the history
  4. 🤖 Lint code

    ivy-branch committed Feb 23, 2024
    Configuration menu
    Copy the full SHA
    ac9e299 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    d4dfe4d View commit details
    Browse the repository at this point in the history

Commits on Feb 25, 2024

  1. Configuration menu
    Copy the full SHA
    a8cffef View commit details
    Browse the repository at this point in the history
  2. 🤖 Lint code

    ivy-branch committed Feb 25, 2024
    Configuration menu
    Copy the full SHA
    5fc6caf View commit details
    Browse the repository at this point in the history

Commits on Feb 27, 2024

  1. Configuration menu
    Copy the full SHA
    66ad054 View commit details
    Browse the repository at this point in the history
  2. 🤖 Lint code

    ivy-branch committed Feb 27, 2024
    Configuration menu
    Copy the full SHA
    7ddbe54 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    99482a2 View commit details
    Browse the repository at this point in the history
  4. 🤖 Lint code

    ivy-branch committed Feb 27, 2024
    Configuration menu
    Copy the full SHA
    0480200 View commit details
    Browse the repository at this point in the history
  5. Updated dtypes in test_classification.py

    for sklearn_metrics precision_score and recall score
    muzakkirhussain011 authored Feb 27, 2024
    Configuration menu
    Copy the full SHA
    ad4fa46 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    d2acd5f View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    f904b6e View commit details
    Browse the repository at this point in the history
  8. 🤖 Lint code

    ivy-branch committed Feb 27, 2024
    Configuration menu
    Copy the full SHA
    d4be9f4 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    02ed1df View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    0bb503c View commit details
    Browse the repository at this point in the history
  11. 🤖 Lint code

    ivy-branch committed Feb 27, 2024
    Configuration menu
    Copy the full SHA
    b1d4d9f View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    22c6c68 View commit details
    Browse the repository at this point in the history
  13. 🤖 Lint code

    ivy-branch committed Feb 27, 2024
    Configuration menu
    Copy the full SHA
    fd9198f View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    80fe8b3 View commit details
    Browse the repository at this point in the history
  15. 🤖 Lint code

    ivy-branch committed Feb 27, 2024
    Configuration menu
    Copy the full SHA
    4b2ee9d View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    fef2396 View commit details
    Browse the repository at this point in the history
  17. 🤖 Lint code

    ivy-branch committed Feb 27, 2024
    Configuration menu
    Copy the full SHA
    9d583b3 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    9e3c701 View commit details
    Browse the repository at this point in the history
  19. 🤖 Lint code

    ivy-branch committed Feb 27, 2024
    Configuration menu
    Copy the full SHA
    5fc8174 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    e8cb8d1 View commit details
    Browse the repository at this point in the history
  21. 🤖 Lint code

    ivy-branch committed Feb 27, 2024
    Configuration menu
    Copy the full SHA
    46336db View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    1033828 View commit details
    Browse the repository at this point in the history
  23. 🤖 Lint code

    ivy-branch committed Feb 27, 2024
    Configuration menu
    Copy the full SHA
    54a4853 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    cff01e9 View commit details
    Browse the repository at this point in the history
  25. 🤖 Lint code

    ivy-branch committed Feb 27, 2024
    Configuration menu
    Copy the full SHA
    5d3a8d6 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    9fe0c06 View commit details
    Browse the repository at this point in the history
  27. 🤖 Lint code

    ivy-branch committed Feb 27, 2024
    Configuration menu
    Copy the full SHA
    f790e91 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    db753fb View commit details
    Browse the repository at this point in the history
  29. 🤖 Lint code

    ivy-branch committed Feb 27, 2024
    Configuration menu
    Copy the full SHA
    72a1a70 View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    1ffa551 View commit details
    Browse the repository at this point in the history
  31. 🤖 Lint code

    ivy-branch committed Feb 27, 2024
    Configuration menu
    Copy the full SHA
    69bdae8 View commit details
    Browse the repository at this point in the history
  32. Configuration menu
    Copy the full SHA
    02095c1 View commit details
    Browse the repository at this point in the history
  33. 🤖 Lint code

    ivy-branch committed Feb 27, 2024
    Configuration menu
    Copy the full SHA
    9bba1d0 View commit details
    Browse the repository at this point in the history

Commits on Feb 28, 2024

  1. Configuration menu
    Copy the full SHA
    128c86c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    20493de View commit details
    Browse the repository at this point in the history
  3. 🤖 Lint code

    ivy-branch committed Feb 28, 2024
    Configuration menu
    Copy the full SHA
    9a7efde View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ad640d1 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    964ca7b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    e4afd6e View commit details
    Browse the repository at this point in the history
  7. 🤖 Lint code

    ivy-branch committed Feb 28, 2024
    Configuration menu
    Copy the full SHA
    c59b930 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    fe0887e View commit details
    Browse the repository at this point in the history
  9. 🤖 Lint code

    ivy-branch committed Feb 28, 2024
    Configuration menu
    Copy the full SHA
    9c2a268 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    7575a01 View commit details
    Browse the repository at this point in the history
  11. 🤖 Lint code

    ivy-branch committed Feb 28, 2024
    Configuration menu
    Copy the full SHA
    d7956f4 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    52862bf View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    1b6db54 View commit details
    Browse the repository at this point in the history
  14. 🤖 Lint code

    ivy-branch committed Feb 28, 2024
    Configuration menu
    Copy the full SHA
    423d5a7 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    a9fb4a4 View commit details
    Browse the repository at this point in the history
  16. 🤖 Lint code

    ivy-branch committed Feb 28, 2024
    Configuration menu
    Copy the full SHA
    6b79f79 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    22aebd2 View commit details
    Browse the repository at this point in the history
  18. Updated

    muzakkirhussain011 authored Feb 28, 2024
    Configuration menu
    Copy the full SHA
    ab7d4ed View commit details
    Browse the repository at this point in the history
  19. 🤖 Lint code

    ivy-branch committed Feb 28, 2024
    Configuration menu
    Copy the full SHA
    209e882 View commit details
    Browse the repository at this point in the history
  20. updated

    muzakkirhussain011 authored Feb 28, 2024
    Configuration menu
    Copy the full SHA
    bc1ae81 View commit details
    Browse the repository at this point in the history
  21. 🤖 Lint code

    ivy-branch committed Feb 28, 2024
    Configuration menu
    Copy the full SHA
    1f9271d View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    f559edb View commit details
    Browse the repository at this point in the history
  23. 🤖 Lint code

    ivy-branch committed Feb 28, 2024
    Configuration menu
    Copy the full SHA
    ea488cd View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    68f85d1 View commit details
    Browse the repository at this point in the history
  25. 🤖 Lint code

    ivy-branch committed Feb 28, 2024
    Configuration menu
    Copy the full SHA
    19dd4d8 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    13aa09b View commit details
    Browse the repository at this point in the history
  27. 🤖 Lint code

    ivy-branch committed Feb 28, 2024
    Configuration menu
    Copy the full SHA
    8843022 View commit details
    Browse the repository at this point in the history