Skip to content

Instantly share code, notes, and snippets.

@alter-sachin
Created April 9, 2024 05:25
Show Gist options
  • Save alter-sachin/7d3fd335d027dccb2e63685baf2e4bdd to your computer and use it in GitHub Desktop.
Save alter-sachin/7d3fd335d027dccb2e63685baf2e4bdd to your computer and use it in GitHub Desktop.
import json
from typing import List, Optional
from dotenv import load_dotenv
from langchain.utils.openai_functions import convert_pydantic_to_openai_function
from langchain_community.chat_models import ChatOpenAI
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.pydantic_v1 import BaseModel
from deepgram import DeepgramClient, DeepgramClientOptions, PrerecordedOptions
import pandas as pd
import json
import requests
from class_list import classes_list
load_dotenv()
# AUDIO_URL = {
# "url": "https://storage.googleapis.com/vama-prod-assets/agora/snapshots/2de269686847de228b60b99f28e86132_privateConsult-871384-Ach._Vandana_Ji-jagdish_0.mp4"
# }
from openai import OpenAI
client = OpenAI()
import os
# from dotenv import load_dotenv, find_dotenv
# _ = load_dotenv(find_dotenv()) # read local .env file
# openai.api_key = os.getenv('OPENAI_API_KEY')
template = """A conversation of official nature between professional will be passed to you. Extract from it all scores that suggest if the classes mentioned
with probability as score of its presence in the conversation. The classes are {{classes_list}}
Do not extract the name of the classes itself. If no classes are mentioned that's fine - you don't need to extract any! Just return an empty list.
Do not make up or guess ANY extra information. Only extract what exactly is in the text."""
prompt = ChatPromptTemplate.from_messages([("system", template), ("human", "{input}")])
# Function output schema
class Paper(BaseModel):
"""Information about classes mentioned."""
title: str
author: Optional[str]
class Info(BaseModel):
"""Information to extract"""
classes: List[Paper]
# Function definition
model = ChatOpenAI()
function = [convert_pydantic_to_openai_function(Info)]
chain = (
prompt
| model.bind(functions=function, function_call={"name": "Info"})
| (
lambda x: json.loads(x.additional_kwargs["function_call"]["arguments"])[
"classes"
]
)
)
# chain = prompt | model.bind(
# functions=function, function_call={"name": "Info"}
# ) | JsonKeyOutputFunctionsParser(key_name="papers")
def get_completion(prompt, model="gpt-3.5-turbo", temperature=0):
messages = [{"role": "user", "content": prompt}]
response = client.chat.completions.create(model=model,
messages=messages,
temperature=temperature)
return response.choices[0].message.content
def get_completion1(prompt, model="gpt-3.5-turbo", temperature=0):
messages = [{"role": "user", "content": prompt}]
response = client.chat.completions.create(model=model,response_format={ "type": "json_object" },
messages=messages,
temperature=temperature)
return response.choices[0].message.content
text_source = '''
NSAP - Indira Gandhi National Old Age Pension Scheme\n\nBPLPensionSenior CitizenSocial Welfare\nCheck Eligibility\nSign in to apply\nDetails\nThe scheme \"Indira Gandhi National Old Age Pension Scheme (IGNOAPS)\" is one of the five sub-schemes of the National Social Assistance Programme (NSAP). Under IGNOAPS, citizens living Below Poverty Line and 60 years or above in age are eligible to apply. A monthly pension of ₹ 200 up to 79 years and ₹ 500 thereafter.\nThe Government of India, on 15th August 1995, introduced the National Social Assistance Programme (NSAP) as a fully funded Centrally Sponsored Scheme targeting the destitute, defined as any person who has little or no regular means of subsistence from his / her own source of income or through financial support from family members or other sources, to be identified by the States and UTs, with the objective of providing a basic level of financial aid. NSAP is being administered by the Ministry of Rural Development. This program is being implemented in rural areas as well as urban areas. \nNSAP represents a significant step towards the fulfillment of the Directive Principles of State Policy enshrined in the Constitution of India which enjoin upon the State to undertake within its means a number of welfare measures. These are intended to secure for the citizen\'s adequate means of livelihood, raise the standard of living, improve public health, provide free and compulsory education for children, etc. \nThe NSAP at present includes five sub-schemes as its components - \na) Indira Gandhi National Old Age Pension Scheme (IGNOAPS)\nb) Indira Gandhi National Widow Pension Scheme (IGNWPS)\nc) Indira Gandhi National Disability Pension Scheme (IGNDPS)\nd) National Family Benefit Scheme (NFBS)\ne) Annapurna Scheme\nObjectives of NSAP - \n1. Provides social assistance benefits to poor households in the case of death, maternity, or old age of the breadwinner.\n2. Ensure minimum national standards, in addition to the benefits, the States are currently providing or might provide in the future.\n3. Ensure uniform social protection to the beneficiaries across the country without interruption.\nExpansion to cover all eligible BPL persons - \nIn 2007, the scheme was expanded to cover all eligible persons Below Poverty Line (BPL).\nBenefits\nA monthly pension of ₹ 200 up to 79 years and ₹ 500 thereafter.\nEligibility\nThe applicant should be a citizen of India.\nThe applicant should be living Below Poverty Line.\nThe applicant should be at least 60 years of age.\nApplication Process\nOnline\nOne can download UMANG App or visit website https://web.umang.gov.in/web_new/home \nThe citizen can login using mobile number and OTP.\nOnce logged In, citizen can search for NSAP.\nClick on “Apply Online”\nFill the basic details, choose the mode of payment of pension, upload photo and click on “Submit”.\nApply Now\nUMANG\nDocuments Required\nDuly filled and self-attested Application Form (proforma given the annexures of the scheme guidelines).\nDomicile Certificate \nResidential Proof (Voter card/ Electricity Bill/Aadhar Card) \nAge Proof (Birth Certificate issued by the School last attended or Municipal authority or SHO or through Medical Board) \nAadhar Number \nBank Passbook \nRation Card \nAffidavit duly attested by Judicial Magistrate/Executive Magistrate that she/he is not in receipt of any pension/ financial assistance from any other source
'''
scheme2 = '''
Indira Gandhi National Widow Pension Scheme\n\nBelow Poverty Line - BPLPensionWidow\nCheck Eligibility\nSign in to apply\nDetails\nIndira Gandhi National Widow Pension Scheme (IGNWPS) is implemented by Ministry of Rural Development, Government of India. It is a non-contributory pension scheme to provide social security to widows of poor family (BPL) of the society.\nBenefits\nA pension of Rs.300/- per month is provided to Widows between 40 years and 79 years. For persons who are 80 years and above the pension is Rs.500/- per month. \nEligibility\nThe eligibility criteria under Indira Gandhi National Widow Pension Scheme (IGNWPS) is:-\n\nThe applicant must be a widow in the age group of 40-79 years.\nThe applicant should belong to a household living below the poverty line according to the criteria prescribed by the Govt. of India\nExclusions\nPension will be discontinued\n\nIn case of remarriage of widow\nOnce the widow moves above poverty line\n\nApplication Process\nOnline\nOffline\nOne can download UMANG App or visit website https://web.umang.gov.in/web_new/home \nThe citizen can login using mobile number and OTP.\nOnce logged In, citizen can search for NSAP.\nClick on “Apply Online”\nFill the basic details, choose the mode of payment of pension, upload photo and click on “Submit”.\n\nApply Now\nUMANG\nDocuments Required\nDeath Certificate of husband – With the name of the surviving wife(widow).\nBPL Card.\nAge Proof - For age, the birth certificate or school certificate may be relied on. In their absence ration card and EPIC may be considered. If there is no valid document, any Medical Officer of any government hospital may be authorized to issue the age certificate.
'''
scheme3 = '''
Mahatma Gandhi National Rural Employment Guarantee Act\n\nEmploymentJobLabourPanchayatUnskilled\nCheck Eligibility\nSign in to apply\nDetails\nAn employment scheme by the Ministry of Rural Development, providing provide at least 100 days of guaranteed wage employment in a financial year to every rural household whose adult members volunteer to do unskilled work. Any Indian citizen above the age of 18 years and residing in a rural area can apply to this scheme. The applicant receives guaranteed employment within 15 days from the date of application.\n\nThe wage is deposited directly in the Bank Account / Post Office Account of the applicant. Wages are paid within a week, or fifteen days at most. Men and Women are paid equally. MGNREGA covers the entire country with the exception of districts that have a hundred percent urban population.\nBenefits\nThe applicant receives guaranteed employment within 15 days from the date of application.\nWork is to be provided within a radius of 5 kilometers of the applicant’s residence if possible, and in any case within the Block. If the applicant lives more than 5 km away from the worksite, he/she will be entitled to a travel and subsistence allowance (10% of the minimum wage).\nWages are paid within a week, or fifteen days at most. Men and Women are paid equally.\nShade, drinking water, and first-aid are provided at every worksite.\n\nExclusive measures for the promotion of the participation of the disabled persons:\nIdentification of suitable works\nMobilization of disabled persons by focussing on awareness and special provisions\nSpecifically identified works for disabled persons in the case of large GPs\nPreference to appoint as mates and as workers for providing drinking water, to manage crèches, etc., at the worksites\nAdoption of tools and equipment/facilities at workplaces\nTreating persons with disabilities with respect\nSpecial drive to ensure 100 days of employment to such households\nProvide a special job card of a distinct color\n\nSpecific attention and provisions for Senior Citizens: \nExclusive senior citizen groups may be formed and special works which require lesser physical effort are identified and allotted to these groups.\n\nSpecific attention and provisions for Internally Displaced Persons:\nA special job card to be provided will be valid till these families are displaced and will lose its validity as soon as they return to their original place of residence.\nEligibility\nThe applicant must be at least 18 years of age.\nThe applicant must be residing in a Rural Area.
'''
scheme4 ='''
Pradhan Mantri Awaas Yojana - Gramin\n\nFinancial AssistanceHousingLoanRural Development\nCheck Eligibility\nDetails\nLaunch on 1st April 2016, Pradhan Mantri Awaas Yojana Gramin (PMAY-G) is centre\'s flagship mission by the Ministry of Rural Development (MoRD), implemented by the Ministry of Housing and Urban Affairs (MoHUA). PMAY-G aims at providing a pucca house, with basic amenities, to all houseless households and those households living in kutcha and dilapidated house. PMAY-G addresses the rural housing shortage and bridges the housing deficit in rural areas of India, contributing significantly to the mission of \"Housing for All\". The minimum size of the houses under PMAY-G is 25 sq m including a dedicated area for hygienic cooking. As of 27th Sept 2022, 2.00 crore houses have been constructed out of the total target of 2.72 crores. The beneficiaries are identified using the Socio-Economic and Caste Census (SECC) parameters and verified by the Gram Sabhas. The amount is transferred directly to the Aadhaar-Linked Bank Account / Post-Office Account of the beneficiary. PMAY-G has been extended for another two years, i.e. till 31st March 2024.\nAim and Objective:\nPMAY-G aims to provide a pucca house with basic amenities to all houseless households and households living in kutcha and dilapidated house in rural areas by 2024. The immediate objective is to cover 1.00 Crore households in rural areas, that are houseless or living in kutcha / dilapidated house, in three years from 2016-17 to 2018-19 and enable construction of quality houses by the beneficiaries using local materials, designs and trained masons. For houses to become homes, adoption of a habitat approach through convergence is proposed.\nBenefits\nFinancial Assistance of ₹ 1,20,000 per unit for plain areas; and ₹ 1,30,000 per unit for hilly areas, difficult areas, and IAP districts (Himalayan states, North-Eastern states, and Union Territories of Jammu & Kashmir).\nA willing beneficiary can avail of institutional finance (loan) of up to ₹ 70,000 at 3% lower interest rate, to build a permanent house. The maximum principal amount for which subsidy can be sought is ₹ 2,00,000.\nThe minimum size of the house shall be is 25 sq m including a dedicated area for hygienic cooking.\nIn convergence with Swachh Bharat Mission-Gramin (SBM-G), the beneficiaries get financial assistance of up to ₹ 12,000 for the construction of toilets.\nIn convergence with MGNREGA, the beneficiary is entitled to employment as unskilled labor (Rural Mason Training) at ₹ 90.95 per day for 95 days.\nIn convergence with Pradhan Mantri Ujjwala Yojana, one LPG connection per house is provided.\nConvergence with different government programmes for piped drinking water, electricity connection, clean & efficient cooking fuel, treatment of social and liquid waste, etc.\nPayments are made electronically directly to bank accounts or post office accounts that are linked to Aadhaar.\nNote: Beneficiaries are identified using the \"Housing Deprivation Parameters\" from the Socio-Economic and Caste Census (SECC) 2011 [https://secc.gov.in/], further verified by the Gram Sabhas.\nEligibility\nThe universe of eligible beneficiaries under PMAY-G will include all the houseless households living in zero, one, or two-room houses with kutcha walls and kutcha roofs (as per SECC data, and subject to the exclusion process).\nCriteria for Automatic/Compulsory Inclusion - \n1.\tHouseholds without shelter\n2.\tDestitute/ living on alms\n3.\tManual scavengers\n4.\tPrimitive Tribal Groups\n5.\tLegally released bonded laborer\nPrioritisation within the Universe\ni. There will be multilayered prioritization within the universe of eligible PMAY-G beneficiaries. Priority will first be assigned on the basis of parameters reflecting housing deprivation in each category viz., SC/ST, Minorities, and Others. \nii. To begin with, households will be prioritized based on houselessness followed by the number of rooms; zero, one, and two rooms, in that order. \niii. In a particular social category viz., SC/ST, Minorities, and Others, households that are houseless or living in houses with a lower number of rooms shall not be ranked below households living in houses with a higher number of rooms.\nWithin the above priority groups, households that fulfill the criteria of \"compulsory inclusion\", will be further elevated. Automatically included households shall not rank lower than other households within a priority group. Inter-se priority within the two subgroups viz. households which are automatically included and otherwise will be determined based on their cumulative deprivation scores. \nThe scores will be calculated from the socio-economic parameters given below with each having equal weight:\ni.\tHouseholds with no adult member between ages 16 to 59\nii.\tFemale-headed households with no adult male member between ages 16 to 59\niii.\tHouseholds with no literate adult above 25 years\niv.\tHouseholds with any disabled member and no able-bodied adult member\nv.\tLandless Households deriving the major part of their income from manual casual labor\nvi. Households with higher deprivation scores will be ranked higher within the subgroups.\nNote: To ensure that assistance is targeted at those who are genuinely deprived and that the selection is objective and verifiable, the housing deprivation parameters in the SECC data will be used for identifying households and then verified by the Gram Sabhas.\nEarmarking of Targets - \nFor SC/ST:\n60% of the target allocated to each State/ UT should be earmarked for SC/STs, subject to the availability of eligible beneficiaries. Within earmarked targets, the proportion of SC and ST is to be decided from time to time by the respective States/UTs. Further, the States/ UTs would be allowed to interchange targets between SC and ST if there are no eligible beneficiaries from either of the category and it is certified as such. In case all eligible SC and ST households are covered, the State/ UT targets would be allocated to beneficiaries from the \'Other\' categories included in the Permanent Wait List drawn from SECC 2011.\nFor Minorities:\nFurther, as far as possible, 15% of the total fund would be earmarked for Minorities at the National Level for households. The allocation of targets for Minorities among the States/UTs will be on the basis of the proportionate rural population of Minorities in the respective State/UT as per Census 2011 data. Minorities notified under Section 2(c) of the National Commission for Minorities Act, 1992 are to be considered eligible for receiving benefits against Minority earmarks.\nFor PwDs:\nAccordingly, in the scheme of PMAY-G, while deciding the inter-se priority among the beneficiaries who are to be provided assistance, households with any disabled member and no able-bodied adult member have been accorded additional deprivation score so that such households are given priority while allotting the houses. Keeping in view the provisions of the Persons with Disabilities Act, of 1995, the States to the extent possible, may ensure that 3% of beneficiaries at the State Level are from among persons with disabilities.\nTie Breaker\nIn case there is a tie with more than one household within a subgroup having the same deprivation score, the households will be ranked according to priority on the basis of the following parameters:\ni.\tHouseholds with widows and next-of-kin of members of defence/paramilitary/police forces killed in action.\nii.\tHouseholds where a member is suffering from leprosy or cancer and People living with HIV (PLHIV).\niii.\tHouseholds with a single girl child.\niv.\tBeneficiary families of the Scheduled Tribes and Other Traditional Forest Dwellers (Recognition of Forest Rights) Act, 2006, commonly known as the Forest Rights Act.\nv.\tTransgender persons.\nExclusions\nStep 1: Exclusion of pucca houses\nAll households living in houses with pucca roofs and/or pucca walls and households living in houses with more than 2 rooms are filtered out.\nStep 2: Automatic Exclusion\nFrom the remaining set of households, all households fulfilling any one of the 13 parameters listed below are automatically excluded:-\n1.\tMotorised two/three/four wheeler/ fishing boat\n2.\tMechanised three/four-wheeler agricultural equipment\n3.\tKisan Credit Card with a credit limit of Rs.50,000 or above\n4.\tHousehold with any member as a Government employee\n5.\tHouseholds with non-agricultural enterprises registered with the Government\n6.\tAny member of the family earning more than Rs.10,000 per month\n7.\tPaying income tax\n8.\tPaying professional tax\n9.\tOwn a refrigerator\n10.\tOwn a landline phone\n11.\tOwn 2.5 acres or more of irrigated land with at least one irrigation equipment\n12.\t5 acres or more of irrigated land for two or more crop seasons\n13.\tOwning at least 7.5 acres of land or more with at least one irrigation equipment
'''
scheme5 = '''
Pradhan Mantri Gram Sadak Yojana\n\nRoadRural\nDetails\nWith the objective of providing rural connectivity, the Government of India launched the Pradhan Mantri Gram Sadak Yojana (referred to as PMGSY-I hereinafter) on 25th December 2000 to provide all-weather access to eligible unconnected habitations with a population of up to 500(Census 2001) in plain area and 250 and above in Special category States(States of North East, Jammu, and Kashmir, Himachal Pradesh, Uttarakhand), Desert Area as identified by Desert Development Program and 88 selected Backward Districts as identified by the Ministry of Home Affairs/Planning Commission as a strategy for poverty alleviation.\n\nAs of 8th December 2021, a total of 6,80,040 km of road length has been constructed under various interventions of Pradhan Mantri Gram Sadak Yojana (PMGSY). The primary objective of PMGSY concerns building robust, all-weather roads in rural habitations and other core areas. Panchayati Rajs and elected local representatives decide which habitations to be selected. This scheme was centrally funded only up to 2015-16. Since then, the funds have been divided between the Centre and the State. For North Eastern and Himalayan States (Jammu & Kashmir, Uttarakhand, and Himachal Pradesh) 90% of a project is the Union Government funds, and 10% of this cost, is the State Government funds. For the Other States, the Union Government funds around 60% of a project while the remaining 40% is by State Government funds.\n\nSome prominent features of PMGSY are -\nProper decentralized planning for the building of roads.\nBuild roads according to the Indian Road Congress and Rural Roads Manual.\n3-tier quality management system.\nAn unbroken flow of funds.\n\n\n\n\nBenefits\nThe benefits of the Pradhan Mantri Gram Sadak Yojana (PMGSY) are -\n1. All-weather connection to the hamlets that are least or not connected.\n2. Overall Development of the country allows for easy movement of goods and vehicles.\n3. There are better employment opportunities for those from villages thanks to road connections.\nEligibility\n1. A region must be a habitation. It cannot be a hamlet or revenue village to be eligible for the Pradhan Mantri Gram Sadak Yojana (PMGSY).\n\n2. The Central Government describes habitation as a population cluster residing within an area that remains constant over time. Some of the local words used to describe a habitation are:\nMajras, Desam, Hamlets, Tolas, Dhanis\n\n3. The hamlet must have a higher population as per the 2001 Census to be eligible for road connection. The eligible habitations have a population of above 500 persons in plain areas and around 250 persons and above in hilly areas.\nApplication Process\nOffline\nThe list of road works to be taken up under the Programme will be finalized each year by the District Panchayat in accordance with the allocation of funds communicated to the district. The District Panchayat has to ensure along with the consultative process, that the lists of proposed road works are part of the Core Network and that new connectivity is given priority.\nDocuments Required\nThe release of the second installment in a year shall be subject to the submission of the following documents:\n\n1. Utilisation Certificate for the funds released earlier, year-wise in the form prescribed.\n2. Certificate by the Bank Manager indicating the balance amount on the date of issue of the Certificate and the interest credited.\n3. A Certificate regarding the requisite physical completion of works\n4. For all releases after October of a year, production of an Audited Statement of Accounts and a Balance Sheet and related Statements, duly certified by the Chartered Accountant for the accounts of the previous financial year.\n5. Outputs of the relevant modules of the OMMAS, duly certified by the SRRDA as being correct and verified by the NRIDA\n6. A certificate from the CEO of SRRDA that Maintenance funds required as per maintenance contracts in force had been spent during the previous financial year. For releases after May of a year, the certificate should also include that 50% of such maintenance fund requirements for the current Financial Year have been released by the State, whereas for releases after November, the certificate should be for 100% of such funds.\n
'''
scheme6='''
Saansad Adarsh Gram Yojana\n\nRural Development\nDetails\nIntroduction\nSaansad Adarsh Gram Yojana (SAGY) was launched on 11th October 2014 with the aim to translate the comprehensive vision of Mahatma Gandhi about an ideal Indian village into reality, keeping in view the present context. Under SAGY, each Member of Parliament adopts a Gram Panchayat and guides its holistic progress giving importance to social development at par with infrastructure. The \'Adarsh Grams\' are to become schools of local development and governance, inspiring other Gram Panchayats. By involving villagers and leveraging scientific tools, a village development plan is prepared under the leadership of a Member of Parliament. The distinct feature of this Yojana is that it is: Demand Driven, Inspired by Society, and Based on People\'s Participation.\n\nObjectives\nTo trigger processes that lead to the holistic development of the identified Gram Panchayats\nTo substantially improve the standard of living and quality of life of all sections of the population through -\nImproved basic amenities, Higher productivity, Enhanced human development, Better livelihood opportunity, Reduced disparities, Access to rights and entitlements, Wider social mobilization, Enriched social capital\nTo generate models of local level development and effective local government which can motivate and inspire neighboring, Gram Panchayats to learn and adapt.\nTo nurture the identified Adarsh Grams as schools of local development to train other gram panchayats\n\nValues\nFar beyond mere infrastructure development, SAGY aims at instilling specific values in the villages and their people so that they get transformed into models for others. These values include:\n1. Adopting people’s participation as an end in itself – ensuring the involvement of all sections of society in all aspects related to the life of the village, especially in decision-making related to governance\n2. Adhering to Antyodaya – enabling the “poorest and the weakest person” in the village to achieve well-being \n3. Affirming gender equality and ensuring respect for women\n4. Guaranteeing social justice\n5. Installing dignity of labor and the spirit of community service and voluntarism\n6. Promoting a culture of cleanliness\n7. Living in consonance with nature – ensuring a balance between development and ecology\n8. Preserving and promoting local cultural heritage\n9. Inculcatng mutual cooperation, self-help, and self-reliance\n10. Fostering peace and harmony in the village community\n11. Bringing about transparency, accountability, and probity in public life\n12. Nurturing local self-governance\n13. Adhering to the values enshrined in the Fundamental Rights and Fundamental Duties of the Indian Constitution\nBenefits\nActivities\nThe elements of an Adarsh Gram would be contexted specific. However, it is still possible to broadly identify the essential activities. They would include:\n1. Personal Development\n2. Social Development\n3. Human Development\n4. Economic Development\n5. Environmental Development\n6. Social Security\n7. Basic amenities & services\n8. Good Governance\n\nPersonal development:\n1. Inculcating hygienic behavior and practices\n2. Fostering healthy habits including daily exercise and games\n3. Reducing risk behavior- alcoholism, smoking, substance abuse, etc.\n\nHuman Development:\n1. Universal access to basic health facilities consisting of health-card, medical examination\n2. Total immunization\n3. Balancing the sex-ratio\n4. 100% institutional delivery\n5. Improving nutrition status for all, with special focus on children, adolescent girls, pregnant women, and lactating mothers\n6. Strong focus on the special needs of Persons with Disability (PWD), especially children and women\n7. Universal access to education facilities up to Class X and retention\n8. Conversion of schools into ‘smart schools\'. Smart schools will have IT-enabled classrooms, e-libraries, and web-based teaching and will make all students e-literate required for providing quality education\n9. Adult literacy\n10. E-literacy\n11. Village libraries including e-libraries\n\nSocial development:\n1. Activities for the promotion of voluntarism like Bharat Nirman Volunteers\n2. Building the capacity of the people to fully participate and contribute to local development\n3. Activities for honoring village elders, and local role models especially women, freedom fighters, and martyrs\n4. Activities for violence and crime-free villages such as:\n 4.1 Setting up Citizen Committees\n 4.2 Sensitization, especially in youth\n5. Village sports and folk arts festivals\n6. Having a village song to instill a sense of pride among the people\n7. Celebrating ‘Village Day’\n8. Proactive steps for inclusion and integration of socially excluded groups, especially Scheduled Castes and Scheduled Tribes\n\nEconomic Development:\nPromoting diversified agricultural and allied livelihoods, including livestock and horticulture, through-\n1. Organic farming\n2. Soil health cards\n3. Crop intensification such as SRI\n4. Setting up of seed banks\n5. Collection and value addition to Non-Timber Forest Produce, Livestock development including Gobar Bank, cattle hostel\n6. Livestock development including Gobar Bank, cattle hostel\n7. Micro-irrigation\n8. Agro-service centers\n\nRural industrialization:\n1. Post-harvest technology applications\n2. Micro-enterprises\n3. Dairy development and processing\n4. Food processing\n5. Traditional Industries\n6. Skill Development of all eligible youth for self-employment and placement\n7. Village Tourism including eco-tourism\nAll the above activities should focus particularly on lifting households out of poverty, for which organizing and federating women SHGs, providing employment to all workers, and bringing about financial inclusion are very important.\n\nEnvironmental Development:\n1. Activities for a clean and green village consist of:\n 1.1 Providing toilets in each household and in all public institutions and ensuring their proper use\n 1.2 Appropriate solid and liquid waste management\n2. Roadside plantations\n3. Tree plantation in accordance with local preferences in homesteads, schools, and public institutions – including green walkways\n4. Social forestry\n5. Watershed management especially renovation and revival of traditional water bodies\n6. Rainwater harvesting- rooftop as well as others\n7. Reducing local pollution of air, water, and land\n\nBasic amenities and services:\n1. Pucca houses for all houseless poor/poor living in kutcha houses\n2. Drinking water, preferably treated piped water with household taps\n3. Internal all-weather roads with covered drains\n4. All weather road connectivity to the main road network\n5. Electricity connection to all households and street lights including from alternative sources of energy, especially solar\n6. Pucca infrastructure for public institutions- Anganwadis, schools, health institutions, 7. Gram Panchayat Office, and libraries\n8. Civic infrastructure including community halls, buildings for SHG federations, playgrounds, and burial grounds/ crematoria\n9. Village markets\n10. Infrastructure for PDS outlets\n11. Micro mini banks /post offices/ATMs\n12. Broadband connectivity and Common Service Centres\n13. Telecom connectivity\n14. CCTVs in public places\n\nSocial Security:\n1. Pensions for all eligible families- old age, disability, and widow\n2. Insurance schemes like Aam Aadmi Bima Yojana\n3. Health insurance- RSBY\n4. PDS- universal access to all eligible households\n\nGood Governance:\n1. Strengthening of local democracy through strong and accountable Gram Panchayats and active Gram Sabhas\n2. e-Governance results in better service delivery\n3. Provision of UIDAI cards to all\n4. Ensuring regular and punctual attendance of government and panchayat staff\n5. Time-bound service delivery in line with Department’s Citizens Charter\n6. Holding of Mahila Gram Sabhas before every Gram Sabha\n7. Holding a Gram Sabha at least 4 times a year\n8. Holding of Bal Sabhas every quarter\n9. Proactive disclosure of all information pertaining to the implementation of the program in the public domain and through wall-writing, and notice boards in the local language. This should necessarily include the list of beneficiaries, item-wise budgets, and expenditures.\n9. Gram Panchayat acting as an information facilitation center\n10. Timely redressal of grievances filed by people, such that:\n10.1 Grievances of all nature to be submitted to the Gram Panchayat / Charge Officer and dated receipt to be given\n10.2 Grievances are to be redressed within three weeks along with a written reply\nInstitutionalization of regular open platforms for the airing of grievances and their redressal, coordinated by the Gram Panchayat\n\nUse of Technology and Innovation In SAGY\nAdopting and adapting technology and introducing innovation is critical to this program. These would work broadly in the following areas:\n1. Space application and remote sensing\n2. Mobile-based technology\n3. Agriculture-related technology and innovations\n4. Livelihood-related technologies and innovations\n5. Appropriate building construction technologies\n6. Road construction technologies\n7. Water supply and sanitation-related technologies\nEligibility\n1. The Gram Panchayat should be the basic unit. \n\n2. The village should have a population of 3000-5000 in plain areas and 1000-3000 in hilly, tribal, and difficult areas. (In districts where this unit size is not available, Gram Panchayats approximating the desirable population size may be chosen.)\n\n3. The MP would identify a suitable Gram Panchayat from the rural area of any district in the country, other than his/her own village or that of his/her spouse.\n\n4. The MP will identify one Gram Panchayat to be taken up immediately, and two others to be taken up a little later. \n\n5. Lok Sabha MP has to choose a Gram Panchayat from within his/her constituency.\n\n6. Rajya Sabha MP has to choose a Gram Panchayat from the rural area of a district of his/her choice in the State from which he/she is elected. \n\n7. In the case of urban constituencies, (where there are no Gram Panchayats), the MP will identify a Gram Panchayat from a nearby rural constituency.\n\n8. The Gram Panchayats once selected by the MP (whose tenures have ended on account of resignation or otherwise) would be continued as such under SAGY irrespective of whether activities have already been initiated in the GP under SAGY or not. The newly elected MPs will have the option to select the GP of their choice and two more subsequently by 2019.
'''
scheme7 ='''
Ministry Of Rural Development\nDeen Dayal Upadhyay Grameen Kaushalya Yojana\n\nEducationEmploymentPlacementSkillTrainingYouth\nCheck Eligibility\nDetails\nThe scheme \"Deen Dayal Upadhyaya Grameen Kaushalya Yojana (DDU-GKY)\" is a skill training and placement program of the Ministry of Rural Development (MoRD). The program focuses on the rural poor youth and its emphasis on sustainable employment through the prominence and incentives given to post-placement tracking, retention, and career progression. DDU-GKY is designed to provide high-quality skill training opportunities to the rural poor, and also to establish a larger ecosystem that supports trained candidates to secure a better future. DDU-GKY aims to skill rural youth who are poor and provide them with jobs having regular monthly wages at or above the minimum wage.\nBenefits\nSkill Training: The program provides skill training to beneficiaries in a variety of sectors, including agriculture, construction, retail, and hospitality. The training is designed to be industry-relevant and to equip beneficiaries with the skills they need to secure employment.\nPlacement Assistance: The program provides placement assistance to beneficiaries by connecting them with potential employers. The program also provides support to beneficiaries during the job search process, such as resume writing and interview preparation.\nPost-Placement Support: The program provides post-placement support to beneficiaries to help them adjust to their new jobs. This support may include mentorship, counseling, and access to resources.\nCareer Progression Support: The program provides career progression support to beneficiaries to help them advance in their careers. This support may include training, mentorship, and access to networking opportunities.\nIncentives for Higher Placements: The program provides incentives to PIAs for placing beneficiaries in higher-paying jobs. This incentive is designed to encourage PIAs to place beneficiaries in jobs that are commensurate with their skills and experience.\nEligibility\nThe target group for DDU-GKY is poor rural youth in the age group 15-35.\nThe upper age limit for women candidates, and candidates belonging to Particularly Vulnerable Tribal Groups (PVTGs), Persons with Disabilities (PwDs), Transgender and other Special Groups like rehabilitated bonded labor, victims of trafficking, manual scavengers, trans-genders, HIV-positive persons, etc shall be 45 years.\n\nThe poor will be identified by a process called Participatory Identification of Poor (PIP). Till the time poor are identified through the use of PIP, apart from the existing list of Below Poverty Line (BPL) households, the applicant qualifying as ANY ONE of the following shall also be eligible to avail of the skilling program even if such youth are not on the BPL list - \nYouth from MGNREGA worker households with at least 15 days of work in the previous financial year by any of its family members.\nYouth from a household with RSBY card wherein the details of youth are mentioned in the card.\nYouth from households who have been issued Antyodaya Anna Yojana / BPL PDS cards.\nYouth from a household where a family member is a member of SHG under NRLM.\nYouth from a household covered under auto inclusion parameters as per SECC, 2011 (when notified).\nApplication Process\nOnline\nStep 1: Visit the Official Website of Kaushal Panjee.\nStep 2: In the Left Pane, click \"Candidate Registration\". You will be taken to the Online Registration Form.\nStep 3: In the \"Registration Type\" section, select \"Fresh/New Registration\" and click \"Next\".\nStep 4: In the corresponding sections, fill in all the mandatory fields, upload the required documents, and click \"Submit\". Note the Registration ID for future reference.\nDocuments Required\nProof of Identity\nProof of Age\nBPL Card (if applicable)\nMGNREGA Card (if applicable)\nRSBY Card (if applicable)\nAAY Card (if applicable)\nSHG Identification (if applicable)\nDisability Certificate, issued by competent authority (if applicable)\nST/SC Certificate, issued by competent authority (if applicable)\nSelf-Certification by the candidate for his/her status as Minority Community (if applicable)
'''
scheme8 ='''
National Family Benefit Scheme\n\nBelow Poverty LineBPLFamilyHousehold\nCheck Eligibility\nSign in to apply\nDetails\nA family welfare scheme under the umbrella scheme ‘National Social Assistance Programme’ (NSAP) by MoRD. In this scheme, financial assistance is provided to the bereaved households in case of the death of the primary breadwinner irrespective of the cause of death. The family benefit will be paid to such surviving member of the household of the deceased poor , who after local inquiry, is found to be the head of the household. The death of such a breadwinner should have occurred whilst he/ she is more than 18 years of age and less than 60 years of age.\n\nBenefits\n₹ 20000/ - will be given as a lump sum assistance to such surviving member of the household of the deceased poor, who after local inquiry, is found to be the head of the household.\nThe assistance would be given to every case of death of breadwinner in a family.\nEligibility\nThe applicant must be a citizen of India.\nThe family of the applicant must be living Below Poverty Line (BPL).\nThe primary breadwinner of the applicant\'s family must have been deceased.\nThe age of the deceased breadwinner must have been more than 18 years and less than 60 years.\nThe applicant must be the succeeding primary breadwinner of the family.\nApplication Process\nOffline\nOnline\nStep 1: Take a print of the application form given in Annexure-III (page no. 47) of the scheme guidelines - \nhttps://nsap.nic.in/Guidelines/nsap_guidelines_oct2014.pdf \n(The application forms are available with the District Social Welfare Officer (DSWO) or Tehsil Social Welfare Officer (TSWO) free of cost.) \nStep 2: The duly filled-in Application forms along with the required documents are to be submitted to the designated officer appointed by the respective state governments. The applicant has to complete the application form and enclose proof regarding age, income, status, address, and death certificate. Complete case is to be submitted to the concerned TSWO which consolidates the lists and forwards to the Block Level Sanctioning Committee. The cases are then submitted to DSWO for accord of sanction by District level sanctioning committee headed by the Director General, Social Welfare Department.
'''
scheme9 ='''
Indira Gandhi National Disability Pension Scheme\n\nBelow Poverty Line - BPLDifferently AbledPension\nCheck Eligibility\nSign in to apply\nDetails\nIndira Gandhi National Disability Scheme was launched on February 2009 by the Ministry of Rural Development headed by the Central Government to support the disabled people in our country. This scheme introduced under National Social Assistance Program provides monthly pension to disabled people for the prosperity of their lives. Any disabled person whose age is more than 18 years, and with disability 80% or more belonging to the poverty line can apply for this scheme. \n\nBenefits\nA pension of Rs.300/- per month is provided to Divyangjan between 18 years and 79 years. For persons who are 80 years and above the pension of Rs.500/- per month will be provided.\n\nEligibility\nThe eligibility criteria for a disabled person to avail the benefits are as follows.\n\nThe age of the applicant should range between 18-79 years.\nThe applicant should be a resident of India.\nThe applicant should be a physically or mentally disabled person.\nThe applicant’s disability should be more than 80%.\nDwarfs are also eligible for this scheme.\nThe applicant should belong to Below Poverty Line.\nApplication Process\nOnline\nOffline\nOne can download UMANG App or visit website https://web.umang.gov.in/web_new/home \nThe citizen can login using mobile number and OTP.\nOnce logged In, citizen can search for NSAP.\nClick on “Apply Online”\nFill the basic details, choose the mode of payment of pension, upload photo and click on “Submit”.\n\nApply Now\nUMANG\nDocuments Required\nBPL Card\nAadhaar card\nAge Proof - For age, the birth certificate or school certificate may be relied on. In their absence ration card and EPIC may be considered. If there is no valid document, any Medical Officer of any government hospital may be authorized to issue the age certificate.\nDisability certificate:- Disability certificate (80% and More) issued from Chief Medical Officer, Community Health Centre or Primary Health Centre will be accepted.\nPassport Size Photographs.\n
'''
scheme10 ='''
Ministry Of Rural Development\nDeendayal Antyodaya Yojana - National Rural Livelihoods Mission\n\nEmploymentLoanSHGSkill\nDetails\nDeendayal Antyodaya Yojana - National Rural Livelihoods Mission (DAY-NRLM) is the flagship program of the Ministry of Rural Development (MoRD) for promoting poverty reduction through building strong institutions for the poor, particularly women, and enabling these institutions to access a range of financial services and livelihoods. DAY-NRLM adopts a demand-driven approach, enabling the States to formulate their own State-specific poverty reduction action plans. The blocks and districts in which all the components of DAY-NRLM would be implemented, either through the SRLMs or partner institutions or NGOs, would be the intensive blocks and districts, whereas the remaining would be non-intensive blocks and districts. National Rural Livelihood Mission (NRLM) is a restructured version of restructuring Swarnajayanti Gram Swarojgar Yojana (SGSY). NRLM was renamed as DAY-NRLM (Deendayal Antyodaya Yojana - National Rural Livelihoods Mission) w.e.f. March 29, 2016. \n\nNRLM has set out with an agenda to cover 7 Crore rural poor households, across 600 districts, 6000 blocks, 2.5 lakh Gram Panchayats and 6 lakh villages in the country through self-managed Self Help Groups (SHGs) and federated institutions and support them for livelihoods collectives in a period of 8-10 years. In addition, the poor would be facilitated to achieve increased access to their rights, entitlements, and public services, diversified risk, and better social indicators of empowerment. NRLM believes in harnessing the innate capabilities of the poor and complements them with capacities (information, knowledge, skills, tools, finance, and collectivization) to participate in the growing economy of the country.\n\nThe Mission\n\"To reduce poverty by enabling the poor households to access gainful self-employment and skilled wage employment opportunities, resulting in appreciable improvement in their livelihoods on a sustainable basis, through building strong grassroots institutions of the poor.\"\n\nThe Core Values\nInclusion of the poorest, and meaningful role to the poorest in all the processes\nTransparency and accountability of all processes and institutions\nOwnership and the key role of the poor and their institutions in all stages – planning, implementation, and, monitoring\nCommunity self-reliance and self-dependence\n\nNRLM implementation is in a Mission Mode. This enables - \n(a) the shift from the present allocation-based strategy to a demand-driven strategy enabling the states to formulate their own livelihoods-based poverty reduction action plans, \n(b) focus on targets, outcomes, and time-bound delivery, \n(c) continuous capacity building, imparting requisite skills and creating linkages with livelihoods opportunities for the poor, including those emerging in the organized sector, and \n(d) monitoring against targets of poverty outcomes. \n\nAs NRLM follows a demand-driven strategy, the States have the flexibility to develop their livelihoods-based perspective plans and annual action plans for poverty reduction. The overall plans would be within the allocation for the state based on inter-se poverty ratios.\nBenefits\nKey benefits of the Scheme include:\nOne member (preferably a woman) from each rural poor household would be brought under the Self Help Group (SHG) network. Women SHG groups would have bank-linkage arrangements.\nSHGs would be federated at the village level and higher levels to provide space, voice and resources and to reduce dependence on external agencies.\nThe Mission consists of four components, viz., (i) social mobilization, community institution, and capacity building; (ii) financial inclusion; (iii) livelihood promotion; and (iv) convergence.\nThe participatory social assessment would be organized to identify and rank all households according to vulnerability. The ranking would be with reference to the poorest of the poor, single woman and woman-headed households, disabled, landless, and migrant labor and they would receive special focus.\nTraining and capacity building of the poor, particularly in relation to managing the institutions, livelihoods, credit absorption, and creditworthiness.\nThe Mission also supports the development of skills for rural youth and their placement, training, and self-employment through rural self-employment institutes (RSETIs), innovations, infrastructure creation, and market support.\nProvision of Revolving Fund as support to SHGs to strengthen their institutional and financial management capacity and build a good credit history.\nProvision of Community Investment Support Fund (CIF) in the intensive blocks to the SHGs through the Federations to advance loans and/or undertake common/collective socio-economic activities.\nIntroduction of financial inclusion model, loaning from banks, association and coordination with banking/financial institutions, and coverage from loss of life, health, etc.\nProvision of Interest Subvention on loans availed by SHGs to cover the difference between the lending rate of the banks and 7%.\nConvergence with various ministries and agencies dealing with poverty reduction of rural poor.\nWith highly decentralized planning; States will have liberty in developing their own action plan for poverty reduction.\nNRLM to have suitable linkages at the district level with District Rural Development Agencies (DRDAs) and Panchayat Raj Institutions (PRIs).\nEligibility\nSHGs should be in active existence at least for the last 6 months as per the books of account of SHGs and not from the date of opening of the S/B account.\nSHGs should be practicing ‘Panchasutras’ i.e., Regular meetin\ngs; Regular savings; Regular inter-loaning; Timely repayment; and Up-to-date books of accounts.\nQualified as per grading norms fixed by NABARD. As and when the federations of the SHGs come to existence, the grading exercise may be done by the Federations to support the banks.\nThe existing defunct SHGs are also eligible for the credit if they are revived and continue to be active for a minimum period of 3 months
'''
def identify_eligibility(text):
prompt = f"""
The text is delimited with triple backticks. \
The text is a description of governemnt scheme of central India \
Identify these queries from the text : \
- What is the name of the scheme?
\
- What all criterias are necessary for person to be eligible for the course, return criterias as list of string. \
\
- Probability between 0 and 1 of each criteria. \
- A user tries applying to this scheme, what all questions should you ask to identify elgibility for the user. Please return a list of questions.
Format your response as JSON Object with \
"name of scheme","criteria_details" "probability" and "questions_asked" as the keys.
if criteria_details reponse is N/A replace it with false
Scheme text: '''{text}'''
"""
response = get_completion1(prompt)
print(response)
r1 = json.loads(response)
return r1
identify_eligibility(text_source)
identify_eligibility(scheme2)
identify_eligibility(scheme3)
identify_eligibility(scheme4)
identify_eligibility(scheme5)
identify_eligibility(scheme6)
identify_eligibility(scheme7)
identify_eligibility(scheme8)
identify_eligibility(scheme9)
identify_eligibility(scheme10)
#identify_eligibility(scheme3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment