diff --git a/apps/opik-documentation/documentation/docs/cookbook/ragas.ipynb b/apps/opik-documentation/documentation/docs/cookbook/ragas.ipynb index 95e6b44edc..94bc891b18 100644 --- a/apps/opik-documentation/documentation/docs/cookbook/ragas.ipynb +++ b/apps/opik-documentation/documentation/docs/cookbook/ragas.ipynb @@ -31,18 +31,34 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Note: you may need to restart the kernel to use updated packages.\n" + ] + } + ], "source": [ "%pip install --quiet --upgrade opik ragas nltk" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "OPIK: Opik is already configured. You can check the settings by viewing the config file at /Users/jacquesverre/.opik.config\n" + ] + } + ], "source": [ "import opik\n", "\n", @@ -60,7 +76,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -92,7 +108,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -121,7 +137,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ @@ -133,9 +149,24 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "OPIK: Started logging traces to the \"ragas-integration\" project at https://www.comet.com/opik/jacques-comet/redirect/projects?name=ragas-integration.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Answer Relevancy score: 0.9999999999999996\n" + ] + } + ], "source": [ "import asyncio\n", "from ragas.integrations.opik import OpikTracer\n", @@ -188,9 +219,27 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "OPIK: Started logging traces to the \"ragas-integration\" project at https://www.comet.com/opik/jacques-comet/redirect/projects?name=ragas-integration.\n" + ] + }, + { + "data": { + "text/plain": [ + "'Paris'" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "from opik import track, opik_context\n", "\n", @@ -245,9 +294,80 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Evaluation: 100%|██████████| 3/3 [00:02<00:00, 1.17it/s]\n" + ] + }, + { + "data": { + "text/html": [ + "
╭─ ragas-demo-dataset (3 samples) ──────╮\n", + "│ │\n", + "│ Total time: 00:00:02 │\n", + "│ Number of samples: 3 │\n", + "│ │\n", + "│ answer_relevancy_metric: 1.0000 (avg) │\n", + "│ │\n", + "╰───────────────────────────────────────╯\n", + "\n" + ], + "text/plain": [ + "╭─ ragas-demo-dataset (3 samples) ──────╮\n", + "│ │\n", + "│ \u001b[1mTotal time: \u001b[0m 00:00:02 │\n", + "│ \u001b[1mNumber of samples:\u001b[0m 3 │\n", + "│ │\n", + "│ \u001b[1;32manswer_relevancy_metric: 1.0000 (avg)\u001b[0m │\n", + "│ │\n", + "╰───────────────────────────────────────╯\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
Uploading results to Opik ... \n",
+ "
\n"
+ ],
+ "text/plain": [
+ "Uploading results to Opik \u001b[33m...\u001b[0m \n"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ },
+ {
+ "data": {
+ "text/html": [
+ "View the results in your Opik dashboard.\n", + "\n" + ], + "text/plain": [ + "View the results \u001b]8;id=566302;https://www.comet.com/opik/jacques-comet/experiments/01936935-83db-72a4-9f81-c1d07efdb433/compare?experiments=%5B%2201948016-66d7-73e7-82e1-fc6d9aae18f7%22%5D\u001b\\in your Opik dashboard\u001b]8;;\u001b\\.\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "EvaluationResult(experiment_id='01948016-66d7-73e7-82e1-fc6d9aae18f7', experiment_name='disastrous_horse_4635', test_results=[TestResult(test_case=TestCase(trace_id='01948016-689f-707c-9c99-7c56aca9b6dd', dataset_item_id='06745f1a-1e67-7d45-8000-730b2f4bfd7c', scoring_inputs={'reference': \"You're confusing a lot of things here. Company B LLC will have it's sales run under Company A LLC, and cease operating as a separate entity These two are contradicting each other. If B LLC ceases to exist - it is not going to have it's sales run under A LLC, since there will be no sales to run for a non-existent company. What happens is that you merge B LLC into A LLC, and then convert A LLC into S Corp. So you're cancelling the EIN for B LLC, you're cancelling the EIN for A LLC - because both entities cease to exist. You then create a EIN for A Corp, which is the converted A LLC, and you create a DBA where A Corp DBA B Shop. You then go to the bank and open the account for A Corp DBA B Shop with the EIN you just created for A Corp. Get a better accountant. Before you convert to S-Corp.\", 'question': '1 EIN doing business under multiple business names', 'answer': '\\nYes, it is possible to have one EIN doing business under multiple business names. This can be done by filing a \"Doing Business As\" (DBA) document with the local government and having the bank call the county seat to verify the DBA. The DBA form will need to be processed and recorded, and there may be a fee associated with this.', 'user_input': '1 EIN doing business under multiple business names', 'ground_truths': [\"You're confusing a lot of things here. Company B LLC will have it's sales run under Company A LLC, and cease operating as a separate entity These two are contradicting each other. If B LLC ceases to exist - it is not going to have it's sales run under A LLC, since there will be no sales to run for a non-existent company. What happens is that you merge B LLC into A LLC, and then convert A LLC into S Corp. So you're cancelling the EIN for B LLC, you're cancelling the EIN for A LLC - because both entities cease to exist. You then create a EIN for A Corp, which is the converted A LLC, and you create a DBA where A Corp DBA B Shop. You then go to the bank and open the account for A Corp DBA B Shop with the EIN you just created for A Corp. Get a better accountant. Before you convert to S-Corp.\"], 'contexts': ['You\\'re confusing a lot of things here. Company B LLC will have it\\'s sales run under Company A LLC, and cease operating as a separate entity These two are contradicting each other. If B LLC ceases to exist - it is not going to have it\\'s sales run under A LLC, since there will be no sales to run for a non-existent company. What happens is that you merge B LLC into A LLC, and then convert A LLC into S Corp. So you\\'re cancelling the EIN for B LLC, you\\'re cancelling the EIN for A LLC - because both entities cease to exist. You then create a EIN for A Corp, which is the converted A LLC, and you create a DBA where A Corp DBA B Shop. You then go to the bank and open the account for A Corp DBA B Shop with the EIN you just created for A Corp. Get a better accountant. Before you convert to S-Corp.You don\\'t need to notify the IRS of new members, the IRS doesn\\'t care (at this stage). What you do need, if you have a EIN for a single-member LLC, is to request a new EIN since your LLC is now a partnership (a different entity, from IRS perspective). From now on, you\\'ll need to file form 1065 with the IRS in case of business related income, on which you will declare the membership distribution interests on Schedules K-1 for each member.\"Depending on where you are, you may be able to get away with filing a \"\"Doing Business As\"\" document with your local government, and then having the bank call the county seat to verify this. There is generally a fee for processing/recording/filing the DBA form, of course. But it\\'s useful for more purposes than just this one. (I still need to file a DBA for my hobby work-for-pay, for exactly this reason.)\"'], 'retrieved_contexts': ['You\\'re confusing a lot of things here. Company B LLC will have it\\'s sales run under Company A LLC, and cease operating as a separate entity These two are contradicting each other. If B LLC ceases to exist - it is not going to have it\\'s sales run under A LLC, since there will be no sales to run for a non-existent company. What happens is that you merge B LLC into A LLC, and then convert A LLC into S Corp. So you\\'re cancelling the EIN for B LLC, you\\'re cancelling the EIN for A LLC - because both entities cease to exist. You then create a EIN for A Corp, which is the converted A LLC, and you create a DBA where A Corp DBA B Shop. You then go to the bank and open the account for A Corp DBA B Shop with the EIN you just created for A Corp. Get a better accountant. Before you convert to S-Corp.You don\\'t need to notify the IRS of new members, the IRS doesn\\'t care (at this stage). What you do need, if you have a EIN for a single-member LLC, is to request a new EIN since your LLC is now a partnership (a different entity, from IRS perspective). From now on, you\\'ll need to file form 1065 with the IRS in case of business related income, on which you will declare the membership distribution interests on Schedules K-1 for each member.\"Depending on where you are, you may be able to get away with filing a \"\"Doing Business As\"\" document with your local government, and then having the bank call the county seat to verify this. There is generally a fee for processing/recording/filing the DBA form, of course. But it\\'s useful for more purposes than just this one. (I still need to file a DBA for my hobby work-for-pay, for exactly this reason.)\"'], 'response': '\\nYes, it is possible to have one EIN doing business under multiple business names. This can be done by filing a \"Doing Business As\" (DBA) document with the local government and having the bank call the county seat to verify the DBA. The DBA form will need to be processed and recorded, and there may be a fee associated with this.'}, task_output={'user_input': '1 EIN doing business under multiple business names', 'response': '\\nYes, it is possible to have one EIN doing business under multiple business names. This can be done by filing a \"Doing Business As\" (DBA) document with the local government and having the bank call the county seat to verify the DBA. The DBA form will need to be processed and recorded, and there may be a fee associated with this.', 'retrieved_contexts': ['You\\'re confusing a lot of things here. Company B LLC will have it\\'s sales run under Company A LLC, and cease operating as a separate entity These two are contradicting each other. If B LLC ceases to exist - it is not going to have it\\'s sales run under A LLC, since there will be no sales to run for a non-existent company. What happens is that you merge B LLC into A LLC, and then convert A LLC into S Corp. So you\\'re cancelling the EIN for B LLC, you\\'re cancelling the EIN for A LLC - because both entities cease to exist. You then create a EIN for A Corp, which is the converted A LLC, and you create a DBA where A Corp DBA B Shop. You then go to the bank and open the account for A Corp DBA B Shop with the EIN you just created for A Corp. Get a better accountant. Before you convert to S-Corp.You don\\'t need to notify the IRS of new members, the IRS doesn\\'t care (at this stage). What you do need, if you have a EIN for a single-member LLC, is to request a new EIN since your LLC is now a partnership (a different entity, from IRS perspective). From now on, you\\'ll need to file form 1065 with the IRS in case of business related income, on which you will declare the membership distribution interests on Schedules K-1 for each member.\"Depending on where you are, you may be able to get away with filing a \"\"Doing Business As\"\" document with your local government, and then having the bank call the county seat to verify this. There is generally a fee for processing/recording/filing the DBA form, of course. But it\\'s useful for more purposes than just this one. (I still need to file a DBA for my hobby work-for-pay, for exactly this reason.)\"']}), score_results=[ScoreResult(name='answer_relevancy_metric', value=0.9999999999999996, reason=None, metadata=None, scoring_failed=False)]), TestResult(test_case=TestCase(trace_id='01948016-68a5-7ac2-938d-11f80d00fcf0', dataset_item_id='06745f1a-1e67-7579-8000-2a216721898a', scoring_inputs={'reference': \"Have the check reissued to the proper payee.Just have the associate sign the back and then deposit it. It's called a third party cheque and is perfectly legal. I wouldn't be surprised if it has a longer hold period and, as always, you don't get the money if the cheque doesn't clear. Now, you may have problems if it's a large amount or you're not very well known at the bank. In that case you can have the associate go to the bank and endorse it in front of the teller with some ID. You don't even technically have to be there. Anybody can deposit money to your account if they have the account number. He could also just deposit it in his account and write a cheque to the business.\", 'question': 'How to deposit a cheque issued to an associate in my business into my business account?', 'answer': '\\nThe best way to deposit a cheque issued to an associate in your business into your business account is to open a business account with the bank. You will need a state-issued \"dba\" certificate from the county clerk\\'s office as well as an Employer ID Number (EIN) issued by the IRS. Once you have opened the business account, you can have the associate sign the back of the cheque and deposit it into the business account.', 'user_input': 'How to deposit a cheque issued to an associate in my business into my business account?', 'ground_truths': [\"Have the check reissued to the proper payee.Just have the associate sign the back and then deposit it. It's called a third party cheque and is perfectly legal. I wouldn't be surprised if it has a longer hold period and, as always, you don't get the money if the cheque doesn't clear. Now, you may have problems if it's a large amount or you're not very well known at the bank. In that case you can have the associate go to the bank and endorse it in front of the teller with some ID. You don't even technically have to be there. Anybody can deposit money to your account if they have the account number. He could also just deposit it in his account and write a cheque to the business.\"], 'contexts': ['Just have the associate sign the back and then deposit it. It\\'s called a third party cheque and is perfectly legal. I wouldn\\'t be surprised if it has a longer hold period and, as always, you don\\'t get the money if the cheque doesn\\'t clear. Now, you may have problems if it\\'s a large amount or you\\'re not very well known at the bank. In that case you can have the associate go to the bank and endorse it in front of the teller with some ID. You don\\'t even technically have to be there. Anybody can deposit money to your account if they have the account number. He could also just deposit it in his account and write a cheque to the business.\"I have checked with Bank of America, and they say the ONLY way to cash (or deposit, or otherwise get access to the funds represented by a check made out to my business) is to open a business account. They tell me this is a Federal regulation, and every bank will say the same thing. To do this, I need a state-issued \"\"dba\"\" certificate (from the county clerk\\'s office) as well as an Employer ID Number (EIN) issued by the IRS. AND their CHEAPEST business banking account costs $15 / month. I think I can go to the bank that the check is drawn upon, and they will cash it, assuming I have documentation showing that I am the sole proprietor. But I\\'m not sure.... What a racket!!\"When a business asks me to make out a cheque to a person rather than the business name, I take that as a red flag. Frankly it usually means that the person doesn\\'t want the money going through their business account for some reason - probably tax evasion. I\\'m not saying you are doing that, but it is a frequent issue. If the company makes the cheque out to a person they may run the risk of being party to fraud. Worse still they only have your word for it that you actually own the company, and aren\\'t ripping off your employer by pocketing their payment. Even worse, when the company is audited and finds that cheque, the person who wrote it will have to justify and document why they made it out to you or risk being charged with embezzlement. It\\'s very much in their interests to make the cheque out to the company they did business with. Given that, you should really have an account in the name of your business. It\\'s going to make your life much simpler in the long run.'], 'retrieved_contexts': ['Just have the associate sign the back and then deposit it. It\\'s called a third party cheque and is perfectly legal. I wouldn\\'t be surprised if it has a longer hold period and, as always, you don\\'t get the money if the cheque doesn\\'t clear. Now, you may have problems if it\\'s a large amount or you\\'re not very well known at the bank. In that case you can have the associate go to the bank and endorse it in front of the teller with some ID. You don\\'t even technically have to be there. Anybody can deposit money to your account if they have the account number. He could also just deposit it in his account and write a cheque to the business.\"I have checked with Bank of America, and they say the ONLY way to cash (or deposit, or otherwise get access to the funds represented by a check made out to my business) is to open a business account. They tell me this is a Federal regulation, and every bank will say the same thing. To do this, I need a state-issued \"\"dba\"\" certificate (from the county clerk\\'s office) as well as an Employer ID Number (EIN) issued by the IRS. AND their CHEAPEST business banking account costs $15 / month. I think I can go to the bank that the check is drawn upon, and they will cash it, assuming I have documentation showing that I am the sole proprietor. But I\\'m not sure.... What a racket!!\"When a business asks me to make out a cheque to a person rather than the business name, I take that as a red flag. Frankly it usually means that the person doesn\\'t want the money going through their business account for some reason - probably tax evasion. I\\'m not saying you are doing that, but it is a frequent issue. If the company makes the cheque out to a person they may run the risk of being party to fraud. Worse still they only have your word for it that you actually own the company, and aren\\'t ripping off your employer by pocketing their payment. Even worse, when the company is audited and finds that cheque, the person who wrote it will have to justify and document why they made it out to you or risk being charged with embezzlement. It\\'s very much in their interests to make the cheque out to the company they did business with. Given that, you should really have an account in the name of your business. It\\'s going to make your life much simpler in the long run.'], 'response': '\\nThe best way to deposit a cheque issued to an associate in your business into your business account is to open a business account with the bank. You will need a state-issued \"dba\" certificate from the county clerk\\'s office as well as an Employer ID Number (EIN) issued by the IRS. Once you have opened the business account, you can have the associate sign the back of the cheque and deposit it into the business account.'}, task_output={'user_input': 'How to deposit a cheque issued to an associate in my business into my business account?', 'response': '\\nThe best way to deposit a cheque issued to an associate in your business into your business account is to open a business account with the bank. You will need a state-issued \"dba\" certificate from the county clerk\\'s office as well as an Employer ID Number (EIN) issued by the IRS. Once you have opened the business account, you can have the associate sign the back of the cheque and deposit it into the business account.', 'retrieved_contexts': ['Just have the associate sign the back and then deposit it. It\\'s called a third party cheque and is perfectly legal. I wouldn\\'t be surprised if it has a longer hold period and, as always, you don\\'t get the money if the cheque doesn\\'t clear. Now, you may have problems if it\\'s a large amount or you\\'re not very well known at the bank. In that case you can have the associate go to the bank and endorse it in front of the teller with some ID. You don\\'t even technically have to be there. Anybody can deposit money to your account if they have the account number. He could also just deposit it in his account and write a cheque to the business.\"I have checked with Bank of America, and they say the ONLY way to cash (or deposit, or otherwise get access to the funds represented by a check made out to my business) is to open a business account. They tell me this is a Federal regulation, and every bank will say the same thing. To do this, I need a state-issued \"\"dba\"\" certificate (from the county clerk\\'s office) as well as an Employer ID Number (EIN) issued by the IRS. AND their CHEAPEST business banking account costs $15 / month. I think I can go to the bank that the check is drawn upon, and they will cash it, assuming I have documentation showing that I am the sole proprietor. But I\\'m not sure.... What a racket!!\"When a business asks me to make out a cheque to a person rather than the business name, I take that as a red flag. Frankly it usually means that the person doesn\\'t want the money going through their business account for some reason - probably tax evasion. I\\'m not saying you are doing that, but it is a frequent issue. If the company makes the cheque out to a person they may run the risk of being party to fraud. Worse still they only have your word for it that you actually own the company, and aren\\'t ripping off your employer by pocketing their payment. Even worse, when the company is audited and finds that cheque, the person who wrote it will have to justify and document why they made it out to you or risk being charged with embezzlement. It\\'s very much in their interests to make the cheque out to the company they did business with. Given that, you should really have an account in the name of your business. It\\'s going to make your life much simpler in the long run.']}), score_results=[ScoreResult(name='answer_relevancy_metric', value=0.9999999999999996, reason=None, metadata=None, scoring_failed=False)]), TestResult(test_case=TestCase(trace_id='01948016-68a2-7b0b-a409-87baca086dd7', dataset_item_id='06745f1a-1e67-7a95-8000-13c09bccb2f4', scoring_inputs={'reference': \"Sure you can. You can fill in whatever you want in the From section of a money order, so your business name and address would be fine. The price only includes the money order itself. You can hand deliver it yourself if you want, but if you want to mail it, you'll have to provide an envelope and a stamp. Note that, since you won't have a bank record of this payment, you'll want to make sure you keep other records, such as the stub of the money order. You should probably also ask the contractor to give you a receipt.\", 'question': 'Can I send a money order from USPS as a business?', 'answer': '\\nYes, you can send a money order from USPS as a business. You can fill in whatever you want in the From section of the money order, including your business name and address. The price only includes the money order itself, so you will need to provide an envelope and a stamp if you want to mail it. It is important to keep records of the payment, such as the stub of the money order, and to ask the contractor for a receipt.', 'user_input': 'Can I send a money order from USPS as a business?', 'ground_truths': [\"Sure you can. You can fill in whatever you want in the From section of a money order, so your business name and address would be fine. The price only includes the money order itself. You can hand deliver it yourself if you want, but if you want to mail it, you'll have to provide an envelope and a stamp. Note that, since you won't have a bank record of this payment, you'll want to make sure you keep other records, such as the stub of the money order. You should probably also ask the contractor to give you a receipt.\"], 'contexts': ['Sure you can. You can fill in whatever you want in the From section of a money order, so your business name and address would be fine. The price only includes the money order itself. You can hand deliver it yourself if you want, but if you want to mail it, you\\'ll have to provide an envelope and a stamp. Note that, since you won\\'t have a bank record of this payment, you\\'ll want to make sure you keep other records, such as the stub of the money order. You should probably also ask the contractor to give you a receipt.\"Lets say you owed me $123.00 an wanted to mail me a check. I would then take the check from my mailbox an either take it to my bank, or scan it and deposit it via their electronic interface. Prior to you mailing it you would have no idea which bank I would use, or what my account number is. In fact I could have multiple bank accounts, so I could decide which one to deposit it into depending on what I wanted to do with the money, or which bank paid the most interest, or by coin flip. Now once the check is deposited my bank would then \"\"stamp\"\" the check with their name, their routing number, the date, an my account number. Eventually an image of the canceled check would then end up back at your bank. Which they would either send to you, or make available to you via their banking website. You don\\'t mail it to my bank. You mail it to my home, or my business, or wherever I tell you to mail it. Some business give you the address of another location, where either a 3rd party processes all their checks, or a central location where all the money for multiple branches are processed. If you do owe a company they will generally ask that in the memo section in the lower left corner that you include your customer number. This is to make sure that if they have multiple Juans the money is accounted correctly. In all my dealings will paying bills and mailing checks I have never been asked to send a check directly to the bank. If they want you to do exactly as you describe, they should provide you with a form or other instructions.\"\"I have checked with Bank of America, and they say the ONLY way to cash (or deposit, or otherwise get access to the funds represented by a check made out to my business) is to open a business account. They tell me this is a Federal regulation, and every bank will say the same thing. To do this, I need a state-issued \"\"dba\"\" certificate (from the county clerk\\'s office) as well as an Employer ID Number (EIN) issued by the IRS. AND their CHEAPEST business banking account costs $15 / month. I think I can go to the bank that the check is drawn upon, and they will cash it, assuming I have documentation showing that I am the sole proprietor. But I\\'m not sure.... What a racket!!\"'], 'retrieved_contexts': ['Sure you can. You can fill in whatever you want in the From section of a money order, so your business name and address would be fine. The price only includes the money order itself. You can hand deliver it yourself if you want, but if you want to mail it, you\\'ll have to provide an envelope and a stamp. Note that, since you won\\'t have a bank record of this payment, you\\'ll want to make sure you keep other records, such as the stub of the money order. You should probably also ask the contractor to give you a receipt.\"Lets say you owed me $123.00 an wanted to mail me a check. I would then take the check from my mailbox an either take it to my bank, or scan it and deposit it via their electronic interface. Prior to you mailing it you would have no idea which bank I would use, or what my account number is. In fact I could have multiple bank accounts, so I could decide which one to deposit it into depending on what I wanted to do with the money, or which bank paid the most interest, or by coin flip. Now once the check is deposited my bank would then \"\"stamp\"\" the check with their name, their routing number, the date, an my account number. Eventually an image of the canceled check would then end up back at your bank. Which they would either send to you, or make available to you via their banking website. You don\\'t mail it to my bank. You mail it to my home, or my business, or wherever I tell you to mail it. Some business give you the address of another location, where either a 3rd party processes all their checks, or a central location where all the money for multiple branches are processed. If you do owe a company they will generally ask that in the memo section in the lower left corner that you include your customer number. This is to make sure that if they have multiple Juans the money is accounted correctly. In all my dealings will paying bills and mailing checks I have never been asked to send a check directly to the bank. If they want you to do exactly as you describe, they should provide you with a form or other instructions.\"\"I have checked with Bank of America, and they say the ONLY way to cash (or deposit, or otherwise get access to the funds represented by a check made out to my business) is to open a business account. They tell me this is a Federal regulation, and every bank will say the same thing. To do this, I need a state-issued \"\"dba\"\" certificate (from the county clerk\\'s office) as well as an Employer ID Number (EIN) issued by the IRS. AND their CHEAPEST business banking account costs $15 / month. I think I can go to the bank that the check is drawn upon, and they will cash it, assuming I have documentation showing that I am the sole proprietor. But I\\'m not sure.... What a racket!!\"'], 'response': '\\nYes, you can send a money order from USPS as a business. You can fill in whatever you want in the From section of the money order, including your business name and address. The price only includes the money order itself, so you will need to provide an envelope and a stamp if you want to mail it. It is important to keep records of the payment, such as the stub of the money order, and to ask the contractor for a receipt.'}, task_output={'user_input': 'Can I send a money order from USPS as a business?', 'response': '\\nYes, you can send a money order from USPS as a business. You can fill in whatever you want in the From section of the money order, including your business name and address. The price only includes the money order itself, so you will need to provide an envelope and a stamp if you want to mail it. It is important to keep records of the payment, such as the stub of the money order, and to ask the contractor for a receipt.', 'retrieved_contexts': ['Sure you can. You can fill in whatever you want in the From section of a money order, so your business name and address would be fine. The price only includes the money order itself. You can hand deliver it yourself if you want, but if you want to mail it, you\\'ll have to provide an envelope and a stamp. Note that, since you won\\'t have a bank record of this payment, you\\'ll want to make sure you keep other records, such as the stub of the money order. You should probably also ask the contractor to give you a receipt.\"Lets say you owed me $123.00 an wanted to mail me a check. I would then take the check from my mailbox an either take it to my bank, or scan it and deposit it via their electronic interface. Prior to you mailing it you would have no idea which bank I would use, or what my account number is. In fact I could have multiple bank accounts, so I could decide which one to deposit it into depending on what I wanted to do with the money, or which bank paid the most interest, or by coin flip. Now once the check is deposited my bank would then \"\"stamp\"\" the check with their name, their routing number, the date, an my account number. Eventually an image of the canceled check would then end up back at your bank. Which they would either send to you, or make available to you via their banking website. You don\\'t mail it to my bank. You mail it to my home, or my business, or wherever I tell you to mail it. Some business give you the address of another location, where either a 3rd party processes all their checks, or a central location where all the money for multiple branches are processed. If you do owe a company they will generally ask that in the memo section in the lower left corner that you include your customer number. This is to make sure that if they have multiple Juans the money is accounted correctly. In all my dealings will paying bills and mailing checks I have never been asked to send a check directly to the bank. If they want you to do exactly as you describe, they should provide you with a form or other instructions.\"\"I have checked with Bank of America, and they say the ONLY way to cash (or deposit, or otherwise get access to the funds represented by a check made out to my business) is to open a business account. They tell me this is a Federal regulation, and every bank will say the same thing. To do this, I need a state-issued \"\"dba\"\" certificate (from the county clerk\\'s office) as well as an Employer ID Number (EIN) issued by the IRS. AND their CHEAPEST business banking account costs $15 / month. I think I can go to the bank that the check is drawn upon, and they will cash it, assuming I have documentation showing that I am the sole proprietor. But I\\'m not sure.... What a racket!!\"']}), score_results=[ScoreResult(name='answer_relevancy_metric', value=0.9999999999999996, reason=None, metadata=None, scoring_failed=False)])])" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "from datasets import load_dataset\n", "from opik.evaluation.metrics import base_metric, score_result\n", @@ -306,6 +426,7 @@ " dataset,\n", " evaluation_task,\n", " scoring_metrics=[scoring_metric],\n", + " task_threads=1,\n", ")" ] }, @@ -322,9 +443,38 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "4b0ea631a30246aa9025e93d5e083588", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Evaluating: 0%| | 0/9 [00:00, ?it/s]" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "OPIK: Started logging traces to the \"ragas-integration\" project at https://www.comet.com/opik/jacques-comet/redirect/projects?name=ragas-integration.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'context_precision': 1.0000, 'faithfulness': 0.8190, 'answer_relevancy': 0.9583}\n" + ] + } + ], "source": [ "from datasets import load_dataset\n", "from ragas.metrics import context_precision, answer_relevancy, faithfulness\n",