ChatWithPDF / app

https://app.chatwithpdf.aitools.samagra.io
0 stars 0 forks source link

Show reference pages as an array on the response #1

Closed ChakshuGautam closed 1 year ago

ChakshuGautam commented 1 year ago

Something like this.

Image

ChakshuGautam commented 1 year ago

@prtkjakhar to define the API response for this kind of output. Mock that API and build the frontend for it. @Amruth-Vamshi to update the API to show this.

ChakshuGautam commented 1 year ago

@prtkjakhar to add the prompt that we are using for this.

prtkjakhar commented 1 year ago

Using this prompt

{ "prompt": [ { "role": "system", "content": "You are a helpful assistant who helps with answering questions based on the provided information. Only answer based on the context provided and do not consider generic information.\n Note: Also give back the content used to phrase the answer in a json format as given below example: {\"answer\": \"Your answer here\", \"content_used\": \"Insert content used for this answer here, it should be exactly same as content given below\"} Consider the user question critically and break down the questions into steps before answering the questions. \n Some expert context is provided in dictionary format here, do not use this if it not related to user question:[{\"combined_prompt\":null,\"combined_content\":\"It must do everything to empower teachers and help them to do their job as effectively as possible. The new education policy must help recruit the very best and brightest to enter the teaching profession at all levels, by ensuring livelihood, respect, dignity, and autonomy, while also instilling in the system basic methods of quality control and accountability. The new education policy must provide to all students, irrespective of their place of residence, a quality education system, with particular focus on historically marginalized, disadvantaged, and underrepresented groups. Education is a great leveler and is the best tool for achieving economic and social mobility, inclusion, and equality. Initiatives must be in place to ensure that all students from such groups, despite inherent obstacles, are provided various targeted opportunities to enter and excel in the educational system. These elements must be incorporated taking into account the local and global needs of the country, and with a respect for and deference to its rich diversity and culture. Instilling knowledge of India and its varied social, cultural, and technological needs, its inimitable artistic, language, and knowledge traditions, and its strong ethics in India’s young people is considered critical for purposes of national pride, self-confidence, self-knowledge, cooperation, and integration. This National Education Policy envisions an education system rooted in Indian ethos that contributes directly to transforming India, that is Bharat, sustainably into an equitable and vibrant knowledge society, by providing high-quality education to all, and thereby making India a global knowledge superpower. The Policy envisages that the curriculum and pedagogy of our institutions must develop among the students a deep sense of respect towards the Fundamental Duties and Constitutional values, bonding with one’s country, and a conscious awareness of one’s roles and responsibilities in a changing world. The vision of the Policy is to instill among the learners a deep-rooted pride in being Indian, not only in thought, but also in spirit, intellect, and deeds, as well as to develop knowledge, skills, values, and dispositions that support responsible commitment to human rights, sustainable development and living, and global well-being, thereby reflecting a truly global citizen.\"},{\"combined_prompt\":null,\"combined_content\":\"The curriculum must include basic arts, crafts, humanities, games, sports and fitness, languages, literature, culture, and values, in addition to science and mathematics, to develop all aspects and capabilities of learners; and make education more well-rounded, useful, and fulfilling to the learner. Education must build character, enable learners to be ethical, rational, compassionate, and caring, while at the same time prepare them for gainful, fulfilling employment. The gap between the current state of learning outcomes and what is required must be bridged through undertaking major reforms that bring the highest quality, equity, and integrity into the system, from early childhood care and education through higher education. The aim must be for India to have an education system by 2040 that is second to none, with equitable access to the highest-quality education for all learners regardless of social or economic background. This National Education Policy 2020 is the first education policy of the 21st century and aims to address the many growing developmental imperatives of our country. This Policy proposes the revision and revamping of all aspects of the education structure, including its regulation and governance, to create a new system that is aligned with the aspirational goals of 21st century education, including SDG4, while building upon India’s traditions and value systems. The National Education Policy lays particular emphasis on the development of the creative potential of each individual.\"},{\"combined_prompt\":null,\"combined_content\":\"It is based on the principle that education must develop not only cognitive capacities - both the ‘foundational capacities ’of literacy and numeracy and ‘higher-order’ cognitive capacities, such as critical thinking and problem solving – but also social, ethical, and emotional capacities and dispositions. The rich heritage of ancient and eternal Indian knowledge and thought has been a guiding light for this Policy. The pursuit of knowledge (Jnan), wisdom (Pragyaa), and truth (Satya) was always considered in Indian thought and philosophy as the highest human goal. The aim of education in ancient India was not just the acquisition of knowledge as preparation for life in this world, or life beyond schooling, but for the complete realization and liberation of the self. World-class institutions of ancient India such as Takshashila, Nalanda,Vikramshila, Vallabhi, set the highest standards of multidisciplinary teaching and research and hosted scholars and students from across backgrounds and countries. The Indian education system produced great scholars such as Charaka, Susruta, Aryabhata, Varahamihira, Bhaskaracharya, Brahmagupta, Chanakya, Chakrapani Datta, Madhava, Panini, Patanjali, Nagarjuna, Gautama, Pingala, Sankardev, Maitreyi, Gargi and Thiruvalluvar, among numerous others, who made seminal contributions to world knowledge in diverse fields such as mathematics, astronomy, metallurgy, medical science and surgery, civil engineering, architecture, shipbuilding and navigation, yoga, fine arts, chess, and more.\"},{\"combined_prompt\":null,\"combined_content\":\"Education is fundamental for achieving full human potential, developing an equitable and just society, and promoting national development. Providing universal access to quality education is the key to India’s continued ascent, and leadership on the global stage in terms of economic growth, social justice and equality, scientific advancement, national integration, and cultural preservation. Universal high-quality education is the best way forward for developing and maximizing our country's rich talents and resources for the good of the individual, the society, the country, and the world. India will have the highest population of young people in the world over the next decade, and our ability to provide high-quality educational opportunities to them will determine the future of our country. The global education development agenda reflected in the Goal 4 (SDG4) of the 2030 Agenda for Sustainable Development, adopted by India in 2015 - seeks to “ensure inclusive and equitable quality education and promote lifelong learning opportunities for all” by 2030.\"},{\"combined_prompt\":null,\"combined_content\":\"The growing emergence of epidemics and pandemics will also call for collaborative research in infectious disease management and development of vaccines and the resultant social issues heightens the need for multidisciplinary learning. There will be a growing demand for humanities and art, as India moves towards becoming a developed country as well as among the three largest economies in the world. Indeed, with the quickly changing employment landscape and global ecosystem, it is becoming increasingly critical that children not only learn, but more importantly learn how to learn. Education thus, must move towards less content, and more towards learning about how to think critically and solve problems, how to be creative and multidisciplinary, and how to innovate, adapt, and absorb new material in novel and changing fields. Pedagogy must evolve to make education more experiential, holistic, integrated, inquiry-driven, discovery-oriented, learner-centred, discussion-based, flexible, and, of course, enjoyable.\"},{\"combined_prompt\":null,\"combined_content\":\"Indian culture and philosophy have had a strong influence on the world. These rich legacies to world heritage must not only be nurtured and preserved for posterity but also researched, enhanced, and put to new uses through our education system. The teacher must be at the centre of the fundamental reforms in the education system. The new education policy must help re-establish teachers, at all levels, as the most respected and essential members of our society, because they truly shape our next generation of citizens.\"},{\"combined_prompt\":null,\"combined_content\":\"Such a lofty goal will require the entire education system to be reconfigured to support and foster learning, so that all of the critical targets and goals (SDGs) of the 2030 Agenda for Sustainable Development can be achieved. The world is undergoing rapid changes in the knowledge landscape. With various dramatic scientific and technological advances, such as the rise of big data, machine learning, and artificial intelligence, many unskilled jobs worldwide may be taken over by machines, while the need for a skilled workforce, particularly involving mathematics, computer science, and data science, in conjunction with multidisciplinary abilities across the sciences, social sciences, and humanities, will be increasingly in greater demand. With climate change, increasing pollution, and depleting natural resources, there will be a sizeable shift in how we meet the world’s energy, water, food, and sanitation needs, again resulting in the need for new skilled labour, particularly in biology, chemistry, physics, agriculture, climate science, and social science.\"}]\n\n " }, { "role": "user", "content": "what must new education policy help in and what all must it include?" } ] }

Getting this response

{ "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "The new education policy must do everything to empower teachers and help them to do their job as effectively as possible. It must help recruit the very best and brightest to enter the teaching profession at all levels, by ensuring livelihood, respect, dignity, and autonomy, while also instilling in the system basic methods of quality control and accountability. The new education policy must provide to all students, irrespective of their place of residence, a quality education system, with particular focus on historically marginalized, disadvantaged, and underrepresented groups. The curriculum must include basic arts, crafts, humanities, games, sports and fitness, languages, literature, culture, and values, in addition to science and mathematics, to develop all aspects and capabilities of learners; and make education more well-rounded, useful, and fulfilling to the learner. Education must build character, enable learners to be ethical, rational, compassionate, and caring, while at the same time prepare them for gainful, fulfilling employment. Initiatives must be in place to ensure that all students from such groups, despite inherent obstacles, are provided various targeted opportunities to enter and excel in the educational system. These elements must be incorporated taking into account the local and global needs of the country, and with a respect for and deference to its rich diversity and culture. Instilling knowledge of India and its varied social, cultural, and technological needs, its inimitable artistic, language, and knowledge traditions, and its strong ethics in India’s young people is considered critical for purposes of national pride, self-confidence, self-knowledge, cooperation, and integration. The National Education Policy lays particular emphasis on the development of the creative potential of each individual. \n\n{\"answer\": \"The new education policy must do everything to empower teachers and help them to do their job as effectively as possible. The new education policy must provide to all students, irrespective of their place of residence, a quality education system, with particular focus on historically marginalized, disadvantaged, and underrepresented groups. The curriculum must include basic arts, crafts, humanities, games, sports and fitness, languages, literature, culture, and values, in addition to science and mathematics, to develop all aspects and capabilities of learners; and make education more well-rounded, useful, and fulfilling to the learner. Education must build character, enable learners to be ethical, rational, compassionate, and caring, while at the same time prepare them for gainful, fulfilling employment. Initiatives must be in place to ensure that all students from such groups, despite inherent obstacles, are provided various targeted opportunities to enter and excel in the educational system. These elements must be incorporated taking into account the local and global needs of the country, and with a respect for and deference to its rich diversity and culture. Instilling knowledge of India and its varied social, cultural, and technological needs, its inimitable artistic, language, and knowledge traditions, and its strong ethics in India’s young people is considered critical for purposes of national pride, self-confidence, self-knowledge, cooperation, and integration. The National Education Policy lays particular emphasis on the development of the creative potential of each individual.\", \"content_used\": \"It must do everything to empower teachers and help them to do their job as effectively as possible. The new education policy must help recruit the very best and brightest to enter the teaching profession at all levels, by ensuring livelihood, respect, dignity, and autonomy, while also instilling in the system basic methods of quality control and accountability. The new education policy must provide to all students, irrespective of their place of residence, a quality education system, with particular focus on historically marginalized, disadvantaged, and underrepresented groups. The curriculum must include basic arts, crafts, humanities, games, sports and fitness, languages, literature, culture, and values, in addition to science and mathematics, to develop all aspects and capabilities of learners; and make education more well-rounded, useful, and fulfilling to the learner. Education must build character, enable learners to be ethical, rational, compassionate, and caring, while at the same time prepare them for gainful, fulfilling employment. Initiatives must be in place to ensure that all students from such groups, despite inherent obstacles, are provided various targeted opportunities to enter and excel in the educational system. These elements must be incorporated taking into account the local and global needs of the country, and with a respect for and deference to its rich diversity and culture. Instilling knowledge of India and its varied social, cultural, and technological needs, its inimitable artistic, language, and knowledge traditions, and its strong ethics in India’s young people is considered critical for purposes of national pride, self-confidence, self-knowledge, cooperation, and integration. The National Education Policy lays particular emphasis on the development of the creative potential of each individual.\"}", "role": "assistant" } } ], "created": 1696352924, "id": "chatcmpl-85dAy9w82p0es4NvK3jT1m5q138RS", "model": "gpt-3.5-turbo-0301", "object": "chat.completion", "usage": { "completion_tokens": 963, "prompt_tokens": 1939, "total_tokens": 2902 } }

ChakshuGautam commented 1 year ago

Something that worked for me

You are a helpful assistant who helps with answering questions based on the provided information. Only answer based on the context provided and do not consider generic information. You provide context number in square brackets.

Examples shared below
---------------------------------------------------
Question: What comes after C.

Context:
1. There is a new alphabet where E comes after C.
2. F comes after E.

Answer: E [1]
------------------------------

Question: What comes after E?
Context:
1. There is a new alphabet where E comes after C.
2. F comes after E.
3. S comes after A.

Answer:
prtkjakhar commented 1 year ago

Got multiple context numbers

Prompt:

You are a helpful assistant who helps with answering questions based on the provided information. Only answer based on the context provided and do not consider generic information. You provide context number in square brackets. You may use more than one context to answer.

Examples shared below
---------------------------------------------------
Question: How many leaves do I get in a year?

Context:
1. You get 22 planned leaves in a year.
2. You can avail 15 wedding leaves.

Answer: You get 22 planned and 15 wedding leaves [1] [2].
------------------------------

Question:  How many total leaves do I get?
Context:
1. You get 22 planned leaves in a year.
2. You can avail 15 wedding leaves.
3. You get 4 optional holidays to choose from as well.
4. You can take sabbatical for 1 month without pay as well.

Answer:

Reply:

You get 22 planned leaves, 15 wedding leaves, and 4 optional holidays in a year [1] [2] [3]. Additionally, you can take a sabbatical for 1 month without pay [4].