0% found this document useful (0 votes)
31 views10 pages

AI Minor Project Jas

Uploaded by

io6.chahat1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views10 pages

AI Minor Project Jas

Uploaded by

io6.chahat1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Page|1

ARTIFICIAL INTELLIGENCE

MINOR PROJECT

Automatic Text Summarization Using AI

SUBMITTED IN PARTIAL FULFILMENT OF THE REQUIREMENTS FOR


THE AWARD OF THE DEGREE OF

BACHELOR OF TECHNOLOGY
(Computer Science and Engineering)

Submitted By:

Ekta walia
D3 CSE A2

CRN: 2215038

URN: 2203427

Department of Computer Science and Engineering


Guru Nanak Dev Engineering College
Page|2

Ludhiana, 141006

INDEX
S. Topic Page No. Sign.
No.
1. Introduction 1

2. Objectives 2

3. Code 3-6

4. Output 7

5. Conclusion 8
Page|3

INTRODUCTION

The proliferation of text-based information in today’s digital era—from academic research

articles to blogs and news reports—has significantly increased the demand for efficient

methods of information retrieval. Users often face the challenge of quickly extracting relevant

information from large documents, especially in situations where time is of the essence.

Automatic text summarization has become a crucial focus within the field of Natural

Language Processing (NLP), offering solutions to generate concise summaries that retain key

points of the original text.

This project introduces a Python-based Sudoku puzzle generator and solver as a practical

example, where the key objective is to handle the large amount of data generated by the Sudoku

algorithm. The code effectively generates Sudoku puzzles and provides functionality to solve

them, while allowing users to interact with the system. Although primarily demonstrating

algorithmic problem-solving, this project mirrors the broader aim of summarization techniques

by condensing complex data (Sudoku puzzles) into simple, solvable steps.


Page|4

OBJECTIVES

The primary objectives of this project are:

• To create a Python-based system that generates and solves Sudoku puzzles efficiently,

providing an interactive interface for users to experience the functionality.

• To showcase the utility of algorithms in managing large volumes of data, even in

smallscale tasks like Sudoku, which is a reflection of broader text summarization

systems that manage vast textual content.

• To offer a user-friendly interface where users can generate new puzzles, view the

solved puzzle, and understand how algorithmic techniques such as backtracking work in

solving logical challenges.

• To demonstrate the potential of Python programming and randomization techniques

in generating unique puzzles with varying levels of complexity.


Page|5

CODE

Python File - first.py import

random

def pattern(r, c): return (3 * (r

% 3) + r // 3 + c) % 9

def shuffle(s): return

random.sample(s, len(s))

def gen_s(empty_cells=50):

rBase = range(3)

rows = [g * 3 + r for g in shuffle(rBase) for r in shuffle(rBase)]

cols = [g * 3 + c for g in shuffle(rBase) for c in shuffle(rBase)]

nums = shuffle(range(1, 10))

board = [[nums[pattern(r, c)] for c in cols] for r in rows]

for _ in range(empty_cells):

board[random.randint(0, 8)][random.randint(0, 8)] = 0


Page|6

return board

def

print_board(board): for

line in board:

print(" ".join(str(num) if num != 0 else "." for num in line))

def find_empty(board):

for r in range(9):

for c in range(9): if

board[r][c] == 0:

return (r, c)

return None

def is_valid(board, num, pos): for i in range(9):

if board[pos[0]][i] == num or board[i][pos[1]] == num:

return False

box_x = pos[1] // 3

box_y = pos[0] // 3
Page|7

for i in range(box_y * 3, box_y * 3 +

3): for j in range(box_x * 3, box_x * 3 +

3): if board[i][j] == num:

return False

return True

def solve(board):

find = find_empty(board)

if not find:

return True

else:

row, col = find

for i in range(1, 10): if

is_valid(board, i, (row, col)):

board[row][col] = i

if solve(board):

return True

board[row][col] = 0
Page|8

return False

def code():

board = None

while True:

a = input("Enter operation: (new: for generating, ans: for showing answer and exit:

for stopping): ")

if a.lower() == 'exit':

print("Thank you for playing..........")

break

elif a.lower() == 'new':

board = gen_s()

print("Generated Sudoku Board: ")

print_board(board)

elif a.lower() ==

'ans': if board is not

None:

print("\nAnswer of Sudoku Board:")

solve(board)

print_board(board)
Page|9

else:

print("No Sudoku board generated yet! Please generate one first using 'new'.")

else:

print(f"You have entered invalid input: {a} (Enter only 'new', 'ans', and

'exit')") if __name__ == "__main__":

print("Welcome........")

code()

OUTPUT
P a g e | 10

CONCLUSION

This project successfully demonstrates the process of generating and solving Sudoku puzzles

using Python. The development of this interactive system highlights the importance of

algorithmic thinking and efficient coding practices in tackling logical challenges. While the

project focuses on Sudoku puzzles, the concepts applied here—such as generating data and then

condensing it into a solution—parallel broader applications like text summarization, where vast

information is distilled into concise summaries.

By achieving the objective of creating a working Sudoku system, this project emphasizes how

algorithmic solutions can simplify complex problems. Future work could explore integrating

this system with more advanced techniques, such as artificial intelligence, to develop Sudoku

solvers capable of handling even more complex variations of the game. Additionally, the code

can serve as a foundation for more complex applications in fields like game theory, machine

learning, and data science.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy